<?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: settings.php,v 1.15.2.7 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                                                   */
/*                                                                      */
/* 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.       */
/************************************************************************/

checkAccess( NULL, NULL, TRUE );


/*********************************************************/
/* Configuration Functions to Setup all the Variables    */
/*********************************************************/

function Configure() {
    global $hlpfile, $admin, $mpnTables;
    include ("config.php");
    include ("header.php");
    GraphicAdmin($hlpfile);
    OpenTable();
    echo "
    <center><font size=2><b>".translate("General Site Info")."</b></font></center><P>
    <form action=admin.php method=post>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Site Name:")." </td><td width=60%><input type=text name=\"xsitename\" value=\"" . stripslashes($sitename) . "\" size=50 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Site URL (Must end with a '/'):")." </td><td width=60%><input type=text name=\"xnuke_url\" value=\"" . _MPN_ROOT_URI . "\" size=50 maxlength=200>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Printer Friendly Page Logo:")." </td><td width=60%><input type=text name=\"xsite_logo\" value=\"$site_logo\" size=20 maxlength=25>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Site Slogan:")." </td><td width=60%><input type=text name=\"xslogan\" value=\"" . stripslashes($slogan) . "\" size=50 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Site Start Date:")." </td><td width=60%><input type=text name=\"xstartdate\" value=\"$startdate\" size=20 maxlength=30>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Administrator Email:")." </td><td width=60%><input type=text name=\"xadminmail\" value=\"$adminmail\" size=30 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">";
    echo translate("Mail Delivery Method:")."</td><td width=60%><select name=\"xmailmethod\">\n";
    echo "<option value=\"0\""; if ($mailmethod == "0") { echo "selected"; } echo ">PHP\n";
    echo "<option value=\"1\""; if ($mailmethod == "1") { echo "selected"; } echo ">SMTP\n";
    echo "</select>";
    echo "</td></tr><tr><td width=40% align=\"right\">
    ".translate("SMTP Server:")." </td><td width=60%><input type=text name=\"xsmtp\" value=\"$smtp\" size=30 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Number of items in TOP Page:")." </td><td><select name=\"xtop\">
    <option name=\"xtop\">$top</option>
    <option name=\"xtop\">5</option>
    <option name=\"xtop\">10</option>
    <option name=\"xtop\">15</option>
    <option name=\"xtop\">20</option>
    <option name=\"xtop\">25</option>
    <option name=\"xtop\">30</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Stories Number in the Home:")." </td><td width=60%><select name=xstoryhome>
    <option name=\"xstoryhome\">$storyhome</option>
    <option name=\"xstoryhome\">5</option>
    <option name=\"xstoryhome\">10</option>
    <option name=\"xstoryhome\">15</option>
    <option name=\"xstoryhome\">20</option>
    <option name=\"xstoryhome\">25</option>
    <option name=\"xstoryhome\">30</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Stories in Old Articles Box:")." </td><td width=60%><select name=\"xoldnum\">
    <option name=\"xoldnum\">$oldnum</option>
    <option name=\"xoldnum\">10</option>
    <option name=\"xoldnum\">20</option>
    <option name=\"xoldnum\">30</option>
    <option name=\"xoldnum\">40</option>
    <option name=\"xoldnum\">50</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Activate Ultramode?")." </td><td width=60%>";
    if ($ultramode==1) {
        echo "<input type=radio name=\"xultramode\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xultramode\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xultramode\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xultramode\" value=0 checked>".translate("No")."";
    }
    echo "</td></tr><tr><td width=40% align=\"right\">
    ".translate("Allow Anonymous to Post?")." </td><td width=60%>";
    if ($anonpost==1) {
        echo "<input type=radio name=\"xanonpost\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xanonpost\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xanonpost\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xanonpost\" value=0 checked>".translate("No")."";
    }
    echo "</td></tr><tr><td width=40% align=\"right\">
    ".translate("Default Theme for your Site:")."</td><td width=60%><select name=\"xDefault_Theme\">";

    $themelist = $_SERVER['F_LIB'] -> buildThemeArray( 1 );

    if ( ! empty( $themelist ) )
    {
        foreach( $themelist as $v )
        {
            $sel = ( $v == $Default_Theme ) ? ( 'selected="yes"' ) : ( '' );

            echo "<option $sel value='$v'>$v</option>\n";
        }
    }
    else
    {
        echo "<option $sel value='{$Default_Theme}'>$Default_Theme</option>\n";
    }

    echo "</select></td></tr><tr><td width=40% align=\"right\">
    " . translate("Select the Language for your Site:") . "</td><td width=60%>";
    if ($hardenc == 0) {
        echo "<select name=\"xlanguage\">";
        $handle=opendir('language');

        while(false !== ($file = readdir( $handle )))
        {
            if (preg_match('/lang\-(.*?)\.php/', $file, $match))
            {
                $languageslist[] = $match[1];
            }
        }

        closedir($handle);

        foreach($languageslist as $value)
        {
            echo '<option value="' . $value . '"';
            if ($value == $language)
            {
                echo ' selected="selected"';
            }

            echo '>' . $value . '</option>' . "\n";
        }

        echo "</select>
            <input type=\"checkbox\" name=\"xhardenc\" value=1>" . translate("Hard encode");
    }
    else {
        echo translate("hardcoded $language.") . "
             <input type=\"hidden\" name=\"xlanguage\" value=\"$language\">
             <input type=\"hidden\" name=\"xhardenc\" value=1>";
    }
    echo "</td></tr><tr><td width=40% align=\"right\">" .
         translate("Locale Time Format:") . "</td><td width=60%><input type=text name=\"xlocale\" value=\"$locale\" size=20 maxlength=40>";
    echo "</td></tr><tr><td width=40% align=\"right\">";
    echo "".translate("Server Time Offset (in hrs):")."</td><td width=60%><select name=\"xserv_offset\">";
        echo "<option value = \"-24\""; if ($serv_offset == "-24") { echo "selected"; } echo ">-24:00 hours</option>\n";
    echo "<option value = \"-23\""; if ($serv_offset == "-23") { echo "selected"; } echo ">-23:00 hours</option>\n";
    echo "<option value = \"-22\""; if ($serv_offset == "-22") { echo "selected"; } echo ">-22:00 hours</option>";
    echo "<option value = \"-21\""; if ($serv_offset == "-21") { echo "selected"; } echo ">-21:00 hours</option>";
    echo "<option value = \"-20\""; if ($serv_offset == "-20") { echo "selected"; } echo ">-20:00 hours</option>\n";
    echo "<option value = \"-19\""; if ($serv_offset == "-19") { echo "selected"; } echo ">-19:00 hours</option>\n";
    echo "<option value = \"-18\""; if ($serv_offset == "-18") { echo "selected"; } echo ">-18:00 hours</option>";
    echo "<option value = \"-17\""; if ($serv_offset == "-17") { echo "selected"; } echo ">-17:00 hours</option>";
    echo "<option value = \"-16\""; if ($serv_offset == "-16") { echo "selected"; } echo ">-16:00 hours</option>";
    echo "<option value = \"-15\""; if ($serv_offset == "-15") { echo "selected"; } echo ">-15:00 hours</option>";
    echo "<option value = \"-14\""; if ($serv_offset == "-14") { echo "selected"; } echo ">-14:00 hours</option>";
    echo "<option value = \"-13\""; if ($serv_offset == "-13") { echo "selected"; } echo ">-13:00 hours</option>";
    echo "<option value = \"-12\""; if ($serv_offset == "-12") { echo "selected"; } echo ">-12:00 hours</option>\n";
    echo "<option value = \"-11\""; if ($serv_offset == "-11") { echo "selected"; } echo ">-11:00 hours</option>\n";
    echo "<option value = \"-10\""; if ($serv_offset == "-10") { echo "selected"; } echo ">-10:00 hours</option>";
    echo "<option value = \"-9\""; if ($serv_offset == "-9") { echo "selected"; } echo ">-9:00 hours</option>";
    echo "<option value = \"-8\""; if ($serv_offset == "-8") { echo "selected"; } echo ">-8:00 hours</option>";
    echo "<option value = \"-7\""; if ($serv_offset == "-7") { echo "selected"; } echo ">-7:00 hours</option>";
    echo "<option value = \"-6\""; if ($serv_offset == "-6") { echo "selected"; } echo ">-6:00 hours</option>";
    echo "<option value = \"-5\""; if ($serv_offset == "-5") { echo "selected"; } echo ">-5:00 hours</option>";
    echo "<option value = \"-4\""; if ($serv_offset == "-4") { echo "selected"; } echo ">-4:00 hours</option>";
    echo "<option value = \"-3\""; if ($serv_offset == "-3") { echo "selected"; } echo ">-3:00 hours</option>";
    echo "<option value = \"-2\""; if ($serv_offset == "-2") { echo "selected"; } echo ">-2:00 hours</option>";
    echo "<option value = \"-1\""; if ($serv_offset == "-1") { echo "selected"; } echo ">-1:00 hours</option>";
    echo "<option value = \"0\""; if ($serv_offset == "0") { echo "selected"; } echo ">".translate("No Offset")."</option>";
    echo "<option value = \"+1\""; if ($serv_offset == "+1") { echo "selected"; } echo ">+1:00 hours</option>";
    echo "<option value = \"+2\""; if ($serv_offset == "+2") { echo "selected"; } echo ">+2:00 hours</option>";
    echo "<option value = \"+3\""; if ($serv_offset == "+3") { echo "selected"; } echo ">+3:00 hours</option>";
    echo "<option value = \"+4\""; if ($serv_offset == "+4") { echo "selected"; } echo ">+4:00 hours</option>";
    echo "<option value = \"+5\""; if ($serv_offset == "+5") { echo "selected"; } echo ">+5:00 hours</option>";
    echo "<option value = \"+6\""; if ($serv_offset == "+6") { echo "selected"; } echo ">+6:00 hours</option>";
    echo "<option value = \"+7\""; if ($serv_offset == "+7") { echo "selected"; } echo ">+7:00 hours</option>";
    echo "<option value = \"+8\""; if ($serv_offset == "+8") { echo "selected"; } echo ">+8:00 hours</option>";
    echo "<option value = \"+9\""; if ($serv_offset == "+9") { echo "selected"; } echo ">+9:00 hours</option>";
    echo "<option value = \"+10\""; if ($serv_offset == "+10") { echo "selected"; } echo ">+10:00 hours</option>";
    echo "<option value = \"+11\""; if ($serv_offset == "+11") { echo "selected"; } echo ">+11:00 hours</option>";
    echo "<option value = \"+12\""; if ($serv_offset == "+12") { echo "selected"; } echo ">+12:00 hours</option>";
    echo "<option value = \"+13\""; if ($serv_offset == "+13") { echo "selected"; } echo ">+13:00 hours</option>";
    echo "<option value = \"+14\""; if ($serv_offset == "+14") { echo "selected"; } echo ">+14:00 hours</option>";
    echo "<option value = \"+15\""; if ($serv_offset == "+15") { echo "selected"; } echo ">+15:00 hours</option>";
    echo "<option value = \"+16\""; if ($serv_offset == "+16") { echo "selected"; } echo ">+16:00 hours</option>";
    echo "<option value = \"+17\""; if ($serv_offset == "+17") { echo "selected"; } echo ">+17:00 hours</option>";
    echo "<option value = \"+18\""; if ($serv_offset == "+18") { echo "selected"; } echo ">+18:00 hours</option>";
    echo "<option value = \"+19\""; if ($serv_offset == "+19") { echo "selected"; } echo ">+19:00 hours</option>";
    echo "<option value = \"+20\""; if ($serv_offset == "+20") { echo "selected"; } echo ">+20:00 hours</option>";
    echo "<option value = \"+21\""; if ($serv_offset == "+21") { echo "selected"; } echo ">+21:00 hours</option>";
    echo "<option value = \"+22\""; if ($serv_offset == "+22") { echo "selected"; } echo ">+22:00 hours</option>";
    echo "<option value = \"+23\""; if ($serv_offset == "+23") { echo "selected"; } echo ">+23:00 hours</option>";
    echo "<option value = \"+24\""; if ($serv_offset == "+24") { echo "selected"; } echo ">+24:00 hours</option>";
    echo "</select></td></tr>";

    echo "</table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Banners Options")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Activate Banners in your site?")."</td><td width=60%>";
    if ($banners==1) {
        echo "<input type=radio name=\"xbanners\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xbanners\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xbanners\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xbanners\" value=0 checked>".translate("No")."";
    }
    echo "</td></tr><tr><td width=40% align=\"right\">
    ".translate("Your IP to not count the hits:")."</td><td width=60%>
    <input type=text name=\"xmyIP\" value=\"$myIP\">
    </td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Footer Messages")."</b></font><P>
    <table width=100% border=0><tr><td align=\"right\">
    ".translate("Footer Line 1:")."</td><td><textarea name=\"xfoot1\" cols=60 rows=10>" . stripslashes($foot1) . "</textarea>
    </td></tr><tr><td align=\"right\">
    ".translate("Footer Line 2:")."</td><td><textarea name=\"xfoot2\" cols=60 rows=10>" . stripslashes($foot2) . "</textarea>
    </td></tr><tr><td align=\"right\">
    ".translate("Footer Line 3:")."</td><td><textarea name=\"xfoot3\" cols=60 rows=10>" . stripslashes($foot3) . "</textarea>
    </td></tr><tr><td align=\"right\">
    ".translate("Footer Line 4:")."</td><td><textarea name=\"xfoot4\" cols=60 rows=10>" . stripslashes($foot4) . "</textarea>";
    echo "</td></tr></table></center>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Backend Configuration")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Backend Title:")."</td><td width=60%><input type=text name=\"xbackend_title\" value=\"" . stripslashes($backend_title) . "\" size=50 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Backend Language:")."</td><td width=60%><input type=text name=\"xbackend_language\" value=\"$backend_language\" size=10 maxlength=10>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Backend Image URL:")."</td><td width=60%><input type=text name=\"xbackend_image\" value=\"$backend_image\" size=50 maxlength=200>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Backend Image Width:")."</td><td width=60%><input type=text name=\"xbackend_width\" value=\"$backend_width\" size=4 maxlength=3>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Backend Image Height:")."</td><td width=60%><input type=text name=\"xbackend_height\" value=\"$backend_height\" size=4 maxlength=3>";
    echo "</td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Web Links Default Config")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Links per Page:")."</td><td width=60%>";
    echo '<select name=xperpage>';
        echo '<option value="10" '; if ($perpage == "10") echo 'selected'; echo '>10';
        echo '<option value="15" '; if ($perpage == "15") echo 'selected'; echo '>15';
        echo '<option value="20" '; if ($perpage == "20") echo 'selected'; echo '>20';
        echo '<option value="25" '; if ($perpage == "25") echo 'selected'; echo '>25';
        echo '<option value="30" '; if ($perpage == "30") echo 'selected'; echo '>30';
        echo '<option value="50" '; if ($perpage == "50") echo 'selected'; echo '>50';
    echo "</select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Hits to be Popular:")."</td><td width=60%>
        <select name=xpopular>
        <option name=xpopular value=$popular selected>$popular</option>
        <option name=xpopular value=100>100</option>
        <option name=xpopular value=250>250</option>
        <option name=xpopular value=500>500</option>
        <option name=xpopular value=1000>1000</option>
        <option name=xpopular value=1500>1500</option>
        <option name=xpopular value=2000>2000</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Number of Links as New:")."</td><td width=60%>
        <select name=xnewlinks>
        <option name=xnewlinks value=$newlinks selected>$newlinks</option>
        <option name=xnewlinks value=10>10</option>
        <option name=xnewlinks value=15>15</option>
        <option name=xnewlinks value=20>20</option>
        <option name=xnewlinks value=25>25</option>
        <option name=xnewlinks value=30>30</option>
        <option name=xnewlinks value=50>50</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Number of Links as Best:")."</td><td width=60%>
        <select name=xtoplinks>
        <option name=xtoplinks value=$toplinks selected>$toplinks</option>
        <option name=xtoplinks value=10>10</option>
        <option name=xtoplinks value=15>15</option>
        <option name=xtoplinks value=20>20</option>
        <option name=xtoplinks value=25>25</option>
        <option name=xtoplinks value=30>30</option>
        <option name=xtoplinks value=50>50</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Links in Search Results:")."</td><td width=60%>
        <select name=xlinksresults>
        <option name=xlinksresults value=$linksresults selected>$linksresults</option>
        <option name=xlinksresults value=10>10</option>
        <option name=xlinksresults value=15>15</option>
        <option name=xlinksresults value=20>20</option>
        <option name=xlinksresults value=25>25</option>
        <option name=xlinksresults value=30>30</option>
        <option name=xlinksresults value=50>50</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Let Anonymous users to post new links?")."</td><td width=60%>";
    if ($links_anonaddlinklock==1) {
        echo "<input type=radio name=\"xlinks_anonaddlinklock\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xlinks_anonaddlinklock\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xlinks_anonaddlinklock\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xlinks_anonaddlinklock\" value=0 checked>".translate("No")."";
    }
    echo "</td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Mail New Stories to Admin")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Notify new submissions by email?")."</td><td width=60%>";
    if ($notify==1) {
        echo "<input type=radio name=\"xnotify\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xnotify\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xnotify\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xnotify\" value=0 checked>".translate("No")."";
    }
    echo "
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Email to send the message:")."</td><td width=60%><input type=text name=xnotify_email value=\"$notify_email\" size=30 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Email Subject:")."</td><td><input type=text name=xnotify_subject value=\"" . stripslashes($notify_subject) . "\" size=50 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Email Message:")."</td><td width=60%><textarea name=xnotify_message cols=60 rows=10>" . stripslashes($notify_message) . "</textarea>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Email Account (From):")."</td><td width=60%><input type=text name=xnotify_from value=\"$notify_from\" size=15 maxlength=25>
    </td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Comments Moderation")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Type of Moderation:")."</td><td width=60%>
    <select name=xmoderate>";
    if ($moderate==1) {
        echo "<option name=\"xmoderate\" value=1 selected>".translate("Moderation by Admin")."</option>
        <option name=\"xmoderate\" value=2>".translate("Moderation by Users")."</option>
        <option name=\"xmoderate\" value=0>".translate("No Moderation")."</option>";
    } elseif ($moderate==2) {
        echo "<option name=\"xmoderate\" value=1>".translate("Moderation by Admin")."</option>
        <option name=\"xmoderate\" value=2 selected>".translate("Moderation by Users")."</option>
        <option name=\"xmoderate\" value=0>".translate("No Moderation")."</option>";
    } elseif ($moderate==0) {
        echo "<option name=\"xmoderate\" value=1>".translate("Moderation by Admin")."</option>
        <option name=\"xmoderate\" value=2>".translate("Moderation by Users")."</option>
        <option name=\"xmoderate\" value=0 selected>".translate("No Moderation")."</option>";
    }
    echo "</select></td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Comments Options")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Comments Limit in Bytes:")."</td><td width=60%><input type=text name=xcommentlimit value=\"$commentlimit\" size=11 maxlength=10>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Anonymous Default Name:")."</td><td width=60%><input type=text name=xanonymous value=$anonymous>
    </td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Voting Booth Options")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Max Poll Options:")."</td><td width=100%>
    <select name=xmaxOptions>
        <option name=xmaxOptions value=$maxOptions>$maxOptions</option>
        <option name=xmaxOptions value=10>10</option>
        <option name=xmaxOptions value=12>12</option>
        <option name=xmaxOptions value=15>15</option>
        <option name=xmaxOptions value=20>20</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Scale of Result Bar:")."</td><td width=60%><input type=text name=xBarScale value=$BarScale size=4 maxlength=3>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Allow users to vote twice?")."</td><td width=60%>";
    if ($setCookies==0) {
        echo "<input type=radio name=\"xsetCookies\" value=0 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xsetCookies\" value=1>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xsetCookies\" value=0>".translate("Yes")." &nbsp;
        <input type=radio name=\"xsetCookies\" value=1 checked>".translate("No")."";
    }
    echo "</td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Some Graphics Stuff")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Topics Images Path:")."</td><td width=60%><input type=text name=\"xtipath\" value=\"$tipath\" size=50 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("User Menu Images Path:")."</td><td width=60%><input type=text name=\"xuserimg\" value=\"$userimg\" size=50 maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Admin Menu Images Path:")."</td><td width=60%><input type=text name=\"xadminimg\" value=\"$adminimg\" size=50 maxlength= maxlength=100>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Graphics in Administration Menu?")."</td><td width=60%>";
    if ($admingraphic==1) {
        echo "<input type=radio name=\"xadmingraphic\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xadmingraphic\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xadmingraphic\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xadmingraphic\" value=0 checked>".translate("No")."";
    }
    echo "</td></tr><tr><td width=40% align=\"right\">
    ".translate("Site Font:")."</td><td width=60%><input type=text name=\"xsite_font\" value=\"$site_font\" size=30 maxlength=100>
    </td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Registration email message text")."</b></font><P>";
    echo "<table width=\"100%\" border=0><tr><td align=\"right\">";

    if (!isset($registration_email_text))
    {
        $registration_email_text = null;
    }

    echo "<tr><td><center><textarea name=\"xregistration_email_text\" cols=60 rows=10>" . stripslashes($registration_email_text) . "</textarea>";
    echo "</center></td></tr></table>";
    CloseTable();
    echo "<P>";
    OpenTable();
    echo "<center><font size=2><b>".translate("Miscelaneous")."</b></font></center><P>
    <table width=100% border=0><tr><td width=40% align=\"right\">
    ".translate("Articles Number in Admin:")."</td><td width=60%>
    <select name=xadmart>
    <option name=xadmart value=$admart>$admart</option>
    <option name=xadmart value=10>10</option>
    <option name=xadmart value=15>15</option>
    <option name=xadmart value=20>20</option>
    <option name=xadmart value=25>25</option>
    <option name=xadmart value=30>30</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Minimum users password length:")."</td><td width=60%>
    <select name=xminpass>
    <option name=xminpass value=$minpass>$minpass</option>
    <option name=xminpass value=3>3</option>
    <option name=xminpass value=5>5</option>
    <option name=xminpass value=8>8</option>
    <option name=xminpass value=10>10</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Number of User Listed:")."</td><td width=60%>
    <select name=xshow_user>
    <option name=xshow_user value=$show_user>$show_user</option>
    <option name=xshow_user value=10>10</option>
    <option name=xshow_user value=20>20</option>
    <option name=xshow_user value=30>30</option>
    <option name=xshow_user value=40>40</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Activate HTTP Referers?")."</td><td width=60%>";
    if ($httpref==1) {
        echo "<input type=radio name=xhttpref value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=xhttpref value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xhttpref\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xhttpref\" value=0 checked>".translate("No")."";
    }
    echo "</td></tr><tr><td width=40% align=\"right\">
    ".translate("How Many Referers you want as Maximum?")."</td><td width=60%>
    <select name=xhttprefmax>
    <option name=xhttprefmax value=$httprefmax>$httprefmax</option>
    <option name=xhttprefmax value=100>100</option>
    <option name=xhttprefmax value=250>250</option>
    <option name=xhttprefmax value=500>500</option>
    <option name=xhttprefmax value=1000>1000</option>
    <option name=xhttprefmax value=1000>2000</option>
    </select>
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Activate Comments in Polls?")."</td><td width=60%>";
    if ($pollcomm==1) {
        echo "<input type=radio name=\"xpollcomm\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xpollcomm\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xpollcomm\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xpollcomm\" value=0 checked>".translate("No")."";
    }
    echo "
    </td></tr><tr><td width=40% align=\"right\">
    ".translate("Activate Ephemerids System?")."</td><td width=60%>";
    if ($Ephemerids==1) {
        echo "<input type=radio name=\"xEphemerids\" value=1 checked>".translate("Yes")." &nbsp;
        <input type=radio name=\"xEphemerids\" value=0>".translate("No")."";
    } else {
        echo "<input type=radio name=\"xEphemerids\" value=1>".translate("Yes")." &nbsp;
        <input type=radio name=\"xEphemerids\" value=0 checked>".translate("No")."";
    }
    echo "</td></tr>";
    echo "<input type=hidden name=op value=ConfigSave>\n";

    // Kiril: New Sanitizer

    echo "<input type='hidden' name='clickit_form' value='xregistration_email_text|xnotify_message|xfoot1|xfoot2|xfoot3|xfoot4' />\n";
    echo "<input type='hidden' name='stripit_form' value='xsitename|xnuke_url|xsite_logo|xslogan|xstartdate|xadminmail|xmailmethod|xsmtp|xtop|xstoryhome|xoldnum|xultramode|xanonpost|xDefault_Theme|xbanners|xmyIP|xbackend_title|xbackend_language|xbackend_image|xbackend_width|xbackend_height|xlanguage|xhardenc|xlocale|xserv_offset|xperpage|xpopular|xnewlinks|xtoplinks|xlinksresults|xlinks_anonaddlinklock|xnotify|xnotify_email|xnotify_subject|xnotify_from|xmoderate|xcommentlimit|xanonymous|xmaxOptions|xBarScale|xsetCookies|xtipath|xuserimg|xadminimg|xadmingraphic|xsite_font|xadmart|xminpass|xshow_user|xhttpref|xhttprefmax|xpollcomm|xEphemerids' />\n";
    echo "<input type='hidden' name='mpn_sectype' value='2' />\n";

    // End Sanitizer

    echo "</table>
    <center><br><br><input class='button' type=submit value=\"".translate("Save Changes")."\"></center>
    </form></td></tr></table></td></tr></table>
    </center>";
    include ("footer.php");
}

function ConfigSave($xsitename, $xnuke_url, $xsite_logo, $xslogan, $xstartdate, $xadminmail, $xmailmethod, $xsmtp, $xtop, $xstoryhome, $xoldnum, $xultramode, $xanonpost, $xDefault_Theme, $xbanners, $xmyIP, $xfoot1, $xfoot2, $xfoot3, $xfoot4, $xbackend_title, $xbackend_language, $xbackend_image, $xbackend_width, $xbackend_height, $xlanguage, $xhardenc, $xlocale, $xserv_offset, $xperpage, $xpopular, $xnewlinks, $xtoplinks, $xlinksresults, $xlinks_anonaddlinklock, $xnotify, $xnotify_email, $xnotify_subject, $xnotify_message, $xnotify_from, $xmoderate, $xcommentlimit, $xanonymous, $xmaxOptions, $xBarScale, $xsetCookies, $xtipath, $xuserimg, $xadminimg, $xadmingraphic, $xsite_font, $xadmart, $xminpass, $xshow_user, $xhttpref, $xhttprefmax, $xpollcomm, $xEphemerids, $xregistration_email_text) {
    global $fct;

    include("config.php");

    $check_ary = array( $_POST['xcommentlimit'], $_POST['xbackend_width'], $_POST['xbackend_height'], $_POST['xBarScale'] );

    $verify_check_ary = $_SERVER['SAN'] -> verifyContent( $check_ary, 5 );

    // Check Num Only

    if ( in_array( (bool)FALSE, $verify_check_ary ) )
    {
        goBack( translate( 'Please Make Sure You Have Numbers In Number Only Fields' ) );
        exit;
    }

    /*$xsitename = addslashes($xsitename);
    $xnuke_url = addslashes($xnuke_url);
    $xsite_logo = addslashes($xsite_logo);
    $xslogan = addslashes($xslogan);
    $xsmtp = addslashes($xsmtp);
    $xstartdate = addslashes($xstartdate);
    $xDefault_Theme = addslashes($xDefault_Theme);
    $xmyIP = addslashes($xmyIP);
    $xfoot1 = addslashes($xfoot1);
    $xfoot2 = addslashes($xfoot2);
    $xfoot3 = addslashes($xfoot3);
    $xfoot4 = addslashes($xfoot4);
    $xbackend_title = addslashes($xbackend_title);
    $xbackend_language = addslashes($xbackend_language);
    $xbackend_image = addslashes($xbackend_image);
    $xbackend_width = addslashes($xbackend_width);
    $xbackend_height = addslashes($xbackend_height);
    $xlanguage = addslashes($xlanguage);
    $xlocale = addslashes($xlocale);
    $xnotify_email = addslashes($xnotify_email);
    $xnotify_subject = addslashes($xnotify_subject);
    $xnotify_message = addslashes($xnotify_message);
    $xnotify_from = addslashes($xnotify_from);
    $xcommentlimit = addslashes($xcommentlimit);
    $xanonymous = addslashes($xanonymous);
    $xtipath = addslashes($xtipath);
    $xuserimg = addslashes($xuserimg);
    $xadminimg = addslashes($xadminimg);
    $xsite_font = addslashes($xsite_font);
    $xregistration_email_text = addslashes($xregistration_email_text);*/


    if (!isset($fct)) { $fct = "original"; }
    /* $file = fopen("config.php", "w");
    $urlarray = parse_url( _MPN_ROOT_URI );
    if (isset($urlarray["path"])) {
        $filename = getcwd()."/admin/$fct/config.php";
    } else {
        $filename = "admin/$fct/config.php";
    }
    $file = fopen($filename, "wb");*/

    $line = "######################################################################\n";
    $content  = "<?php\n\n";
    $content .= require './admin/configs_header.php';
    $content .= "$line";
    $content .= "\n";
    $content .= "/*********************************************************************/\n";
    $content .= "/* Now you can change all                                            */\n";
    $content .= "/* you want in the Administration Section.   To enter just launch    */\n";
    $content .= "/* you web browser pointing to http://yourdomain.com/admin.php       */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* At the prompt use the following ID to login (case sensitive):     */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* AdminID: God                                                      */\n";
    $content .= "/* Password: Password                                                */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* Be sure to change inmediately the God login & password clicking   */\n";
    $content .= "/* on Edit Admin in the Admin menu. After that, click on Preferences */\n";
    $content .= "/* to configure your new site. In that menu you can change all you   */\n";
    $content .= "/* need to change.                                                   */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* Remember to chmod 666 this file in order to let the system write  */\n";
    $content .= "/* to it properly. If you can't change the permissions you can edit  */\n";
    $content .= "/* the rest of this file by hand.                                    */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* Congratulations! now you have an automated news portal!           */\n";
    $content .= "/* Thanks for choose PHP-Nuke: The Future of the Web                 */\n";
    $content .= "/*********************************************************************/\n";
    $content .= "\n\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# General Site Configuration\n";
    $content .= "#\n";
    $content .= "# \$sitename:      Your Site Name\n";
    $content .= "# \$nuke_url:      Automatically Determined\n";
    $content .= "# \$site_logo:     Logo for Printer Friendly Page (It's good to have a Black/White graphic)\n";
    $content .= "# \$slogan:        Your site's slogan\n";
    $content .= "# \$startdate:     Start Date to display in Statistic Page\n";
    $content .= "# \$adminmail:     Site Administrator's Email\n";
    $content .= "# \$mailmethod:    Choose your method of how mail gets delivered\n";
    $content .= "# \$smtp:          SMTP Server\n";
    $content .= "# \$anonpost:      Allow Anonymous to Post Comments? (1=Yes 0=No)\n";
    $content .= "# \$Default_Theme: Default Theme for your site (See /themes directory for the complete list, case sensitive!)\n";
    $content .= "# \$foot(x):       Messages for all footer pages (Can include HTML code)\n";
    $content .= "# \$commentlimit:  Maximum number of bytes for each comment\n";
    $content .= "# \$anonymous:     Anonymous users Default Name\n";
    $content .= "# \$site_font:     Font for your entire site (Comma separated for many fonts type)\n";
    $content .= "# \$minpass:       Minimum character for users passwords\n";
    $content .= "# \$pollcomm:      Activate comments in Polls? (1=Yes 0=No)\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$sitename = \"$xsitename\";\n";
    $content .= "\$nuke_url = \"$xnuke_url\";\n";
    $content .= "\$site_logo = \"$xsite_logo\";\n";
    $content .= "\$slogan = \"$xslogan\";\n";
    $content .= "\$startdate = \"$xstartdate\";\n";
    $content .= "\$adminmail = \"$xadminmail\";\n";
    $content .= "\$mailmethod = $xmailmethod;\n";
    $content .= "\$smtp = \"$xsmtp\";\n";
    $content .= "\$anonpost = $xanonpost;\n";
    $content .= "\$Default_Theme = \"$xDefault_Theme\";\n";
    $content .= "\$foot1 = \"$xfoot1\";\n";
    $content .= "\$foot2 = \"$xfoot2\";\n";
    $content .= "\$foot3 = \"$xfoot3\";\n";
    $content .= "\$foot4 = \"$xfoot4\";\n";
    $content .= "\$commentlimit = $xcommentlimit;\n";
    $content .= "\$anonymous = \"$xanonymous\";\n";
    $content .= "\$site_font = \"$xsite_font\";\n";
    $content .= "\$minpass = $xminpass;\n";
    $content .= "\$pollcomm = $xpollcomm;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# General Stories Options\n";
    $content .= "#\n";
    $content .= "# \$top:       How many items in Top Page?\n";
    $content .= "# \$storyhome: How many stories to display in Home Page?\n";
    $content .= "# \$oldnum:    How many stories in Old Articles Box?\n";
    $content .= "# \$ultramode: Activate ultramode plain text file backend syndication? (1=Yes 0=No  Need to chmod 666 ultramode.txt file)\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$top = $xtop;\n";
    $content .= "\$storyhome = $xstoryhome;\n";
    $content .= "\$oldnum = $xoldnum;\n";
    $content .= "\$ultramode = $xultramode;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Banners/Advertising Configuration\n";
    $content .= "#\n";
    $content .= "# \$banners: Activate Banners Ads for your site? (1=Yes 0=No)\n";
    $content .= "# \$myIP:    Write your IP number to not count impressions, be fair about this!\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$banners = $xbanners;\n";
    $content .= "\$myIP = \"$xmyIP\";\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# XML/RDF Backend Configuration\n";
    $content .= "#\n";
    $content .= "# \$backend_title:    Backend title, can be your site's name and slogan\n";
    $content .= "# \$backend_language: Language format of your site\n";
    $content .= "# \$backend_image:    Image logo for your site\n";
    $content .= "# \$backend_width:    Image logo width\n";
    $content .= "# \$backend_height:   Image logo height\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$backend_title = \"$xbackend_title\";\n";
    $content .= "\$backend_language = \"$xbackend_language\";\n";
    $content .= "\$backend_image = \"$xbackend_image\";\n";
    $content .= "\$backend_width = $xbackend_width;\n";
    $content .= "\$backend_height = $xbackend_height;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Site Language Preferences\n";
    $content .= "#\n";
    $content .= "# \$language: Language of your site (You need to have lang-xxxxxx.php file for your selected language in the /language directory of your site)\n";
    $content .= "# \$hardenc:  1 if language is hard encoded\n";
    $content .= "# \$locale:   Locale configuration to correctly display date with your country format. (See /usr/share/locale)\n";
    $content .= "# \$serv_offset:   Adjust server time to local time\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$language = \"$xlanguage\";\n";
    $content .= "\$hardenc = $xhardenc;\n";
    $content .= "\$locale = \"$xlocale\";\n";
    $content .= "\$serv_offset = $xserv_offset;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Web Links Preferences\n";
    $content .= "#\n";
    $content .= "# \$perpage:                  How many links to show on each page?\n";
    $content .= "# \$popular:                  How many hits need a link to be listed as popular?\n";
    $content .= "# \$newlinks:                 How many links to display in the New Links Page?\n";
    $content .= "# \$toplinks:                 How many links to display in The Best Links Page? (Most Popular)\n";
    $content .= "# \$linksresults:             How many links to display on each search result page?\n";
    $content .= "# \$links_anonaddlinklock: Let Anonymous users to post new links? (1=Yes 0=No)\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$perpage = $xperpage;\n";
    $content .= "\$popular = $xpopular;\n";
    $content .= "\$newlinks = $xnewlinks;\n";
    $content .= "\$toplinks = $xtoplinks;\n";
    $content .= "\$linksresults = $xlinksresults;\n";
    $content .= "\$links_anonaddlinklock = $xlinks_anonaddlinklock;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Notification of News Submissions\n";
    $content .= "#\n";
    $content .= "# \$notify:         Notify you each time your site receives a news submission? (1=Yes 0=No)\n";
    $content .= "# \$notify_email:   Email, address to send the notification\n";
    $content .= "# \$notify_subject: Email subject\n";
    $content .= "# \$notify_message: Email body, message\n";
    $content .= "# \$notify_from:    account name to appear in From field of the Email\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$notify = $xnotify;\n";
    $content .= "\$notify_email = \"$xnotify_email\";\n";
    $content .= "\$notify_subject = \"$xnotify_subject\";\n";
    $content .= "\$notify_message = \"$xnotify_message\";\n";
    $content .= "\$notify_from = \"$xnotify_from\";\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Moderation Config (not 100% working)\n";
    $content .= "#\n";
    $content .= "# \$moderate:   Activate moderation system? (1=Yes 0=No)\n";
    $content .= "# \$resons:     List of reasons for the moderation (each reason under quotes and comma separated)\n";
    $content .= "# \$badreasons: Number of bad reasons in the reasons list\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$moderate = $xmoderate;\n";
    $content .= "\$reasons = array( 'As Is', 'Offtopic', 'Flamebait', 'Troll', 'Redundant', 'Insightful', 'Interesting', 'Informative', 'Funny', 'Overrated', 'Underrated' );\n";
    $content .= "\$badreasons = 4;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Surveys/Polls Config\n";
    $content .= "#\n";
    $content .= "# \$maxOptions: Number of maximum options for each poll\n";
    $content .= "# \$BarScale:   Scale for the Bar, multiple of 100, You may leave this to 1\n";
    $content .= "# \$setCookies: Set cookies to prevent visitors vote twice in a period of 24 hours? (1=Yes 0=No)\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$maxOptions = $xmaxOptions;\n";
    $content .= "\$BarScale = $xBarScale;\n";
    $content .= "\$setCookies = $xsetCookies;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Some Graphics Options\n";
    $content .= "#\n";
    $content .= "# \$tipath:       Topics images path (put / only at the end, not at the begining)\n";
    $content .= "# \$userimg:      User images path (put / only at the end, not at the begining)\n";
    $content .= "# \$adminimg:     Administration system images path (put / only at the end, not at the begining)\n";
    $content .= "# \$admingraphic: Activate graphic menu for Administration Menu? (1=Yes 0=No)\n";
    $content .= "# \$admart:       How many articles to show in the admin section?\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$tipath = \"$xtipath\";\n";
    $content .= "\$userimg = \"$xuserimg\";\n";
    $content .= "\$adminimg = \"$xadminimg\";\n";
    $content .= "\$admingraphic = $xadmingraphic;\n";
    $content .= "\$admart = $xadmart;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# HTTP Referers Options\n";
    $content .= "#\n";
    $content .= "# \$httpref:    Activate HTTP referer logs to know who is linking to our site? (1=Yes 0=No)";
    $content .= "# \$httprefmax: Maximum number of HTTP referers to store in the Database (Try to not set this to a high number, 500 ~ 1000 is Ok)\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$httpref = $xhttpref;\n";
    $content .= "\$httprefmax = $xhttprefmax;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Allowable HTML tags\n";
    $content .= "#\n";
    $content .= "# \$AllowableHTML: HTML command to allow in the comments\n";
    $content .= "#                  =>2 means accept all qualifiers: <foo bar>\n";
    $content .= "#                  =>1 means accept the tag only: <foo>\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$AllowableHTML = array(\"p\"=>2,\n" .
                "                       \"b\"=>1,\n" .
                "                       \"i\"=>1,\n" .
                "                       \"a\"=>2,\n" .
                "                       \"em\"=>1,\n" .
                "                       \"br\"=>1,\n" .
                "                       \"strong\"=>1,\n" .
                "                       \"blockquote\"=>1,\n" .
                "                       \"tt\"=>1,\n" .
                "                       \"li\"=>1,\n" .
                "                       \"ol\"=>1,\n" .
                "                       \"ul\"=>1);\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Miscelaneous Options\n";
    $content .= "#\n";
    $content .= "# \$Ephemerids:    Activate Ephemerids (Past Events) system? (1=Yes 0=No)\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$Ephemerids = $xEphemerids;\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Filters Options (not working yet)\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$MaxTextLength = 0;\n";
    $content .= "\$MaxTotalLength = 0;\n";
    $content .= "\$CensorList = array();\n";
    $content .= "\$CensorMode = 1;\n";
    $content .= "\$CensorReplace = \"*\";\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Do not touch the following options!\n";
    $content .= "$line";
    $content .= "\n";
    $content .= "\$cookieadmtime = 2592000;\n";
    $content .= "\$cookiePrefix = \"NukePoll\";\n";
    $content .= "\$uimages = \"\$userimg\$language\";\n";
    $content .= "\$Version_Num = \"$Version_Num\";\n";
    $content .= "\n";
    $content .= "#########################\n";
    $content .= "# Show a number of user #\n";
    $content .= "#########################\n";
    $content .= "\n";
    $content .= "\$show_user = $xshow_user;";
    $content .= "# How many users to display in admin section?\n";
    $content .= "\n";
    $content .= "$line";
    $content .= "# Textblock in a registration emailmessage containing special information and rules about your site #\n";
    $content .= "$line";
    $content .= "\$registration_email_text = \"$xregistration_email_text\";\n";
    $content .= "\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;
    }

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

    if (($xhardenc == 1) && ($hardenc == 0)) {
        include("admin/hardencode.php");
        hardencode($xlanguage);
    }

    $_SERVER['F_LIB'] -> redirectRequest( 'admin.php?op=AdminMain' );
}

switch($op) {

                case "Configure":
                        Configure();
                        break;

                case "ConfigSave":
                        ConfigSave($xsitename, $xnuke_url, $xsite_logo, $xslogan, $xstartdate, $xadminmail, $xmailmethod, $xsmtp, $xtop, $xstoryhome, $xoldnum, $xultramode, $xanonpost, $xDefault_Theme, $xbanners, $xmyIP, $xfoot1, $xfoot2, $xfoot3, $xfoot4, $xbackend_title, $xbackend_language, $xbackend_image, $xbackend_width, $xbackend_height, $xlanguage, (isset($xhardenc)) ? 1 : 0, $xlocale, $xserv_offset, $xperpage, $xpopular, $xnewlinks, $xtoplinks, $xlinksresults, $xlinks_anonaddlinklock, $xnotify, $xnotify_email, $xnotify_subject, $xnotify_message, $xnotify_from, $xmoderate, $xcommentlimit, $xanonymous, $xmaxOptions, $xBarScale, $xsetCookies, $xtipath, $xuserimg, $xadminimg, $xadmingraphic, $xsite_font, $xadmart, $xminpass, $xshow_user, $xhttpref, $xhttprefmax, $xpollcomm, $xEphemerids, $xregistration_email_text);
                        break;
}

?>
