###############################################################################
# CP_CfgGeneral.src                                                           #
###############################################################################
# UltraBoard 2000 by UltraScripts.com, Inc.                                   #
# Scripts written by Jacky Wing Wa Yung, WebMaster@UltraScripts.com           #
# Available from http://www.UltraBoard.org/                                   #
# =========================================================================== #
# COPYRIGHT NOTICE :                                                          #
#                                                                             #
# Copyright (c) 1999-2000 UltraScripts.com, Inc. All Rights Reserved.         #
#                                                                             #
# This program is being distributed as shareware. It may be used and modified #
# free for personal, government or non-profit. Any commercial use must be     #
# registered. However, modified versions cannot be sold or distributed. You   #
# cannot alter the copyright and "powered by" notices throughout the scripts. #
# These notices must be clearly visible to the end users.                     #
#                                                                             #
# WARRANTY DISCLAIMER:                                                        #
#                                                                             #
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT #
# ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR       #
# FITNESS FOR A PARTICULAR PURPOSE.                                           #
###############################################################################

package Source;

&Standard::Require("Cfg.lib", "$UB::LIBRARIES_PATH/Cfg.lib");

sub CfgGeneral {
  my ($ERROR) = @_;

  (
    my ($Groups) = &DB::Query (
      TABLE   => "Groups",
      COLUMNS => ["ID", "TITLE"]
    )
  ) || &HTML::Error("Members Accounts Management / Create a new member account", "No group available for you to choose yet.<br>Sorry, you have to <a href=\"$SYSTEM::CP_URL/Panel.$SYSTEM::EXT?action=CreateGroup\" target=\"UBBODY\">create a new member group</a> first!");

  &Standard::PrintHTMLHeader();
  print &HTML::Header;
  print<<HTML;
<form action="$SYSTEM::CP_URL/Panel.$SYSTEM::EXT" method="post" name="form">
<input type="hidden" name="action" value="DoCfgGeneral">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr bgcolor="Gray">
    <td><font color="White"><b>
      <a href="$SYSTEM::CP_URL/Panel.$SYSTEM::EXT?action=body" target="UBBODY" class="address">Control Panel</a> / General Management / Configure general options
    </b></font></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
          <td>
            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
              <tr>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td>
HTML

  if ($ERROR ne "") {
    print<<HTML;
                        There were the following errors during updating system options.<br>
                        <table width="100%" border="0" cellspacing="2" cellpadding="2">
                          <tr>
                            <td><font color="#FF0000">$ERROR</font></td>
                          </tr>
                        </table>
                        Please make any changes and try again!<br>
HTML
  }

print<<HTML;
                      Please fill out all required (<font color="Red"><b>*</b></font>) fields.
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>

HTML

print<<HTML;
&nbsp;<br>
&nbsp;&nbsp;General Informations
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
 <tr>
  <td>
   <table width="100%" border="0" cellspacing="0" cellpadding="2">
HTML

  print &TextField (
    TITLE       => "Website Name",
    DESCRIPTION => "the name of your website.",
    NAME        => "SITE_NAME",
    VALUE       => $UB::QUERY{'SITE_NAME'} || $GENERAL::SITE_NAME,
    REQUIRED    => "1",

    MAXLENGTH   => "",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Website Address",
    DESCRIPTION => "the url of your website.",
    NAME        => "SITE_URL",
    VALUE       => $UB::QUERY{'SITE_URL'} || $GENERAL::SITE_URL,
    REQUIRED    => "1",

    MAXLENGTH   => "",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "UltraBoard Name",
    DESCRIPTION => "the name of your forum.",
    NAME        => "ULTRABOARD_NAME",
    VALUE       => $UB::QUERY{'ULTRABOARD_NAME'} || $GENERAL::ULTRABOARD_NAME,
    REQUIRED    => "1",

    MAXLENGTH   => "",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "UltraBoard Description",
    DESCRIPTION => "description of your forum.",
    NAME        => "ULTRABOARD_DESCRIPTION",
    VALUE       => $UB::QUERY{'ULTRABOARD_DESCRIPTION'} || $GENERAL::ULTRABOARD_DESCRIPTION,
    REQUIRED    => "1",

    MAXLENGTH   => "",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Contact Email",
    DESCRIPTION => "contact email address (it will show to user for contact you)",
    NAME        => "CONTACT_EMAIL",
    VALUE       => $UB::QUERY{'CONTACT_EMAIL'} || $GENERAL::CONTACT_EMAIL,
    REQUIRED    => "0",

    MAXLENGTH   => "",
    SIZE        => "30"
  );

  print<<HTML;
<script type="text/javascript" language="JavaScript">
<!--
function wf_add_option(f)
{
  var filter   = f.WORD_FILTER;
  var word     = f.wf_word;
  var exactly  = f.wf_exactly;
  var replace  = f.wf_replace;
  if (word.value != "") {
    filter.value = filter.value + word.value + ":";
    if (exactly.checked) {
      filter.value = filter.value + "b";
    }
    filter.value = filter.value + ":" + replace.value;
    filter.value = filter.value + "\|";
  }
  word.value  = "";
  replace.value  = "";
  exactly.checked = false;
}
-->
</script>
<tr>
  <td width="200" valign="top" nowrap>Words Filter</td>
  <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan=5><textarea cols="30" rows="3" name="WORD_FILTER" style="width:100%" class="TextArea">$GENERAL::WORD_FILTER\|</textarea></td>
    </tr>
    <tr>
      <td nowrap><input type="button" name="wf_add" value="add" onClick="wf_add_option(this.form)">&nbsp;</td>
      <td nowrap><input type="text" name="wf_word"></td>
      <td nowrap><input type="checkbox" name="wf_exactly" value="b">exactly</td>
      <td nowrap>&nbsp;&nbsp;&nbsp;replace to&nbsp;</td>
      <td width="100%"><input type="text" name="wf_replace" style="width:100%"></td>
    </tr>
  </table></td>
  <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="add any words that you want to replace ([b] mean exactly same word appear on username)"></td>
</tr>
HTML

print<<HTML;
   </table>
  </td>
 </tr>
</table>
HTML

print<<HTML;
&nbsp;<br>
&nbsp;&nbsp;Display Options
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
 <tr>
  <td>
   <table width="100%" border="0" cellspacing="0" cellpadding="2">
HTML

  print &Radio (
    TITLE       => "UltraBoard Front Page",
    DESCRIPTION => "if you want to allow visitors to see the front page of your ultraboard, then turn it on. (it is good to turn off, if you only have one board.)",
    NAME        => "INDEX",
    VALUE       => [
      {
        VALUE => "0",
        TITLE => "On"
      }, {
        VALUE => "1",
        TITLE => "Off"
      }
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'INDEX'} || $GENERAL::INDEX,
    REQUIRED    => "0"
  );

  print &TextField (
    TITLE       => "Redirect URL",
    DESCRIPTION => "if you turned off the ultraboard front page, then type the url that you want to redirect vistors to... when they visit the ultraboard front page. (e.g. \"http://www.yourdomain.com\")",
    NAME        => "INDEX_URL",
    VALUE       => $UB::QUERY{'INDEX_URL'} || $GENERAL::INDEX_URL || 0,
    REQUIRED    => "0",

    MAXLENGTH   => "",
    SIZE        => "30"
  );

  print &Radio (
    TITLE       => "Login First",
    DESCRIPTION => "if you want your vistors have to be logged in first, then turn it on. (required the ultraboard front page is on)",
    NAME        => "LOGIN",
    VALUE       => [
      {
        VALUE => "1",
        TITLE => "On"
      }, {
        VALUE => "0",
        TITLE => "Off"
      }
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'LOGIN'} || $GENERAL::LOGIN || 0,
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Categories Only",
    DESCRIPTION => "turn it on this if you only want categories displayed. (it is good to turn on when you have a lot of boards)",
    NAME        => "CATEGORY_ONLY",
    VALUE       => [
      { VALUE => "1", TITLE => "On" },
      { VALUE => "0", TITLE => "Off"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'CATEGORY_ONLY'} || $GENERAL::CATEGORY_ONLY || 0,
    REQUIRED    => "0",
  );

  print &Select (
    TITLE       => "Day Prune",
    DESCRIPTION => "the default number of days that topics will be shown in each board.",
    NAME        => "DAY_PRUNE",
    VALUE       => [
      { VALUE => "1"  , TITLE => "Show topics from last day"      },
      { VALUE => "2"  , TITLE => "Show topics from last 2 days"   },
      { VALUE => "3"  , TITLE => "Show topics from last 3 days"   },
      { VALUE => "7"  , TITLE => "Show topics from last 7 days"   },
      { VALUE => "14" , TITLE => "Show topics from last 14 days"  },
      { VALUE => "30" , TITLE => "Show topics from last 30 days"  },
      { VALUE => "45" , TITLE => "Show topics from last 45 days"  },
      { VALUE => "60" , TITLE => "Show topics from last 60 days"  },
      { VALUE => "90" , TITLE => "Show topics from last 90 days"  },
      { VALUE => "180", TITLE => "Show topics from last 180 days" },
      { VALUE => "360", TITLE => "Show topics from last 360 days" },
      { VALUE => "*"  , TITLE => "Show all topics"                }
    ],
    SELECT      => ($UB::QUERY{'DAY_PRUNE'}) ? [$UB::QUERY{'DAY_PRUNE'}] : [$GENERAL::DAY_PRUNE],
    REQUIRED    => "0",
  );

  print &Select (
    TITLE       => "# of Headlines/Page",
    DESCRIPTION => "the default number of headines that will be shown in each board.",
    NAME        => "HEADLINES_PER_PAGE",
    VALUE       => [
      { VALUE => "10" , TITLE => "10 of Headlines/Page"  },
      { VALUE => "20" , TITLE => "20 of Headlines/Page"  },
      { VALUE => "30" , TITLE => "30 of Headlines/Page"  },
      { VALUE => "10" , TITLE => "40 of Headlines/Page"  },
      { VALUE => "50" , TITLE => "50 of Headlines/Page"  },
      { VALUE => "60" , TITLE => "60 of Headlines/Page"  },
      { VALUE => "70" , TITLE => "70 of Headlines/Page"  },
      { VALUE => "80" , TITLE => "80 of Headlines/Page"  },
      { VALUE => "90" , TITLE => "90 of Headlines/Page"  },
      { VALUE => "100", TITLE => "100 of Headlines/Page" },
      { VALUE => "110", TITLE => "110 of Headlines/Page" },
      { VALUE => "120", TITLE => "120 of Headlines/Page" },
      { VALUE => "130", TITLE => "130 of Headlines/Page" },
      { VALUE => "110", TITLE => "140 of Headlines/Page" },
      { VALUE => "150", TITLE => "150 of Headlines/Page" },
      { VALUE => "160", TITLE => "160 of Headlines/Page" },
      { VALUE => "170", TITLE => "170 of Headlines/Page" },
      { VALUE => "180", TITLE => "180 of Headlines/Page" },
      { VALUE => "190", TITLE => "190 of Headlines/Page" },
      { VALUE => "200", TITLE => "200 of Headlines/Page" }
    ],
    SELECT      => ($UB::QUERY{'HEADLINES_PER_PAGE'}) ? [$UB::QUERY{'HEADLINES_PER_PAGE'}] : [$GENERAL::HEADLINES_PER_PAGE],
    REQUIRED    => "0",
  );

  print &Select (
    TITLE       => "# of Posts/Topic",
    DESCRIPTION => "the default number of posts that will be shown in each topic.",
    NAME        => "POST_PER_PAGE",
    VALUE       => [
      { VALUE => "10" , TITLE => "10 of Posts/Page"  },
      { VALUE => "20" , TITLE => "20 of Posts/Page"  },
      { VALUE => "30" , TITLE => "30 of Posts/Page"  },
      { VALUE => "10" , TITLE => "40 of Posts/Page"  },
      { VALUE => "50" , TITLE => "50 of Posts/Page"  },
      { VALUE => "60" , TITLE => "60 of Posts/Page"  },
      { VALUE => "70" , TITLE => "70 of Posts/Page"  },
      { VALUE => "80" , TITLE => "80 of Posts/Page"  },
      { VALUE => "90" , TITLE => "90 of Posts/Page"  },
      { VALUE => "100", TITLE => "100 of Posts/Page" }
    ],
    SELECT      => ($UB::QUERY{'POST_PER_PAGE'}) ? [$UB::QUERY{'POST_PER_PAGE'}] : [$GENERAL::POST_PER_PAGE],
    REQUIRED    => "0",
  );

  print &Select (
    TITLE       => "Hot Topics",
    DESCRIPTION => "how many replies in topic that can become hot topic.",
    NAME        => "HOT",
    VALUE       => [
      { VALUE => "10" , TITLE => "at least 10 replies"  },
      { VALUE => "20" , TITLE => "at least 20 replies"  },
      { VALUE => "30" , TITLE => "at least 30 replies"  },
      { VALUE => "40" , TITLE => "at least 40 replies"  },
      { VALUE => "50" , TITLE => "at least 50 replies"  },
      { VALUE => "60" , TITLE => "at least 60 replies"  },
      { VALUE => "70" , TITLE => "at least 70 replies"  },
      { VALUE => "80" , TITLE => "at least 80 replies"  },
      { VALUE => "90" , TITLE => "at least 90 replies"  },
      { VALUE => "100", TITLE => "at least 100 replies" }
    ],
    SELECT      => ($UB::QUERY{'HOT'}) ? [$UB::QUERY{'HOT'}] : [$GENERAL::HOT],
    REQUIRED    => "0",
  );

  print &Select (
    TITLE       => "Popular Topics",
    DESCRIPTION => "how many people read the topic that can become hot topic.",
    NAME        => "POP",
    VALUE       => [
      { VALUE => "10"   , TITLE => "at least 10 hits"    },
      { VALUE => "20"   , TITLE => "at least 20 hits"    },
      { VALUE => "30"   , TITLE => "at least 30 hits"    },
      { VALUE => "10"   , TITLE => "at least 40 hits"    },
      { VALUE => "50"   , TITLE => "at least 50 hits"    },
      { VALUE => "60"   , TITLE => "at least 60 hits"    },
      { VALUE => "70"   , TITLE => "at least 70 hits"    },
      { VALUE => "80"   , TITLE => "at least 80 hits"    },
      { VALUE => "90"   , TITLE => "at least 90 hits"    },
      { VALUE => "100"  , TITLE => "at least 100 hits"   },
      { VALUE => "200"  , TITLE => "at least 200 hits"   },
      { VALUE => "300"  , TITLE => "at least 300 hits"   },
      { VALUE => "400"  , TITLE => "at least 400 hits"   },
      { VALUE => "500"  , TITLE => "at least 500 hits"   },
      { VALUE => "600"  , TITLE => "at least 600 hits"   },
      { VALUE => "700"  , TITLE => "at least 700 hits"   },
      { VALUE => "800"  , TITLE => "at least 800 hits"   },
      { VALUE => "900"  , TITLE => "at least 900 hits"   },
      { VALUE => "1000" , TITLE => "at least 1000 hits"  },
      { VALUE => "1500" , TITLE => "at least 1500 hits"  },
      { VALUE => "2000" , TITLE => "at least 2000 hits"  },
      { VALUE => "2500" , TITLE => "at least 2500 hits"  },
      { VALUE => "3000" , TITLE => "at least 3000 hits"  },
      { VALUE => "3500" , TITLE => "at least 3500 hits"  },
      { VALUE => "4000" , TITLE => "at least 4000 hits"  },
      { VALUE => "4500" , TITLE => "at least 4500 hits"  },
      { VALUE => "5000" , TITLE => "at least 5000 hits"  },
      { VALUE => "5500" , TITLE => "at least 5500 hits"  },
      { VALUE => "6000" , TITLE => "at least 6000 hits"  },
      { VALUE => "6500" , TITLE => "at least 6500 hits"  },
      { VALUE => "7000" , TITLE => "at least 7000 hits"  },
      { VALUE => "7500" , TITLE => "at least 8500 hits"  },
      { VALUE => "8000" , TITLE => "at least 9000 hits"  },
      { VALUE => "9500" , TITLE => "at least 9500 hits"  },
      { VALUE => "10000", TITLE => "at least 10000 hits" }
    ],
    SELECT      => ($UB::QUERY{'POP'}) ? [$UB::QUERY{'POP'}] : [$GENERAL::POP],
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Print Button",
    DESCRIPTION => "enable the printable version?",
    NAME        => "PRINT",
    VALUE       => [
      {
        VALUE => "1",
        TITLE => "On"
      }, {
        VALUE => "0",
        TITLE => "Off"
      }
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'PRINT'} || $GENERAL::PRINT || 0,
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Forward Button",
    DESCRIPTION => "enable the forward function? (required mail function enabled)",
    NAME        => "FORWARD",
    VALUE       => [
      {
        VALUE => "1",
        TITLE => "On"
      }, {
        VALUE => "0",
        TITLE => "Off"
      }
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'FORWARD'} || $GENERAL::FORWARD || 0,
    REQUIRED    => "0",
  );

print<<HTML;
   </table>
  </td>
 </tr>
</table>
HTML

print<<HTML;
&nbsp;<br>
&nbsp;&nbsp;Registration Options
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
 <tr>
  <td>
   <table width="100%" border="0" cellspacing="0" cellpadding="2">
HTML

  my $GroupOptions;
  for (my $i = 0; $i <= $#{ $Groups }; $i++) {
    push (
      @{ $GroupOptions },
      {
        VALUE => $Groups->[$i]{'ID'},
        TITLE => $Groups->[$i]{'TITLE'}
      }
    );
  }

  print &Select (
    TITLE       => "Default Member Group",
    DESCRIPTION => "which group do you want your members in by default?",
    NAME        => "DEFAULT_GROUP",
    VALUE       => $GroupOptions,
    SELECT      => ($UB::QUERY{'DEFAULT_GROUP'}) ? [$UB::QUERY{'DEFAULT_GROUP'}] : [$GENERAL::DEFAULT_GROUP],
    REQUIRED    => "0",
  );

  print &TextField (
    TITLE       => "Text of Member Level 30",
    DESCRIPTION => "the name of member level 30 (normal member)",
    NAME        => "MEMBER_LEVEL_30",
    VALUE       => $UB::QUERY{'MEMBER_LEVEL_30'} || $GENERAL::MEMBER_LEVEL_30 || "Normal member",
    REQUIRED    => "0",

    MAXLENGTH   => "64",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Text of Member Level 50",
    DESCRIPTION => "the name of member level 50 (premium member)",
    NAME        => "MEMBER_LEVEL_50",
    VALUE       => $UB::QUERY{'MEMBER_LEVEL_50'} || $GENERAL::MEMBER_LEVEL_50 || "Premium member",
    REQUIRED    => "0",

    MAXLENGTH   => "64",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Text of Member Level 70",
    DESCRIPTION => "the name of member level 70 (team member)",
    NAME        => "MEMBER_LEVEL_70",
    VALUE       => $UB::QUERY{'MEMBER_LEVEL_70'} || $GENERAL::MEMBER_LEVEL_70 || "Team member",
    REQUIRED    => "0",

    MAXLENGTH   => "64",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Text of Member Level 100",
    DESCRIPTION => "the name of member level 100 (administrator)",
    NAME        => "MEMBER_LEVEL_100",
    VALUE       => $UB::QUERY{'MEMBER_LEVEL_100'} || $GENERAL::MEMBER_LEVEL_100 || "Administrator",
    REQUIRED    => "0",

    MAXLENGTH   => "64",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Upgrade level",
    DESCRIPTION => "level 30 members have to post how many message to become level 50 members?",
    NAME        => "UPGRADE_LEVEL",
    VALUE       => $UB::QUERY{'UPGRADE_LEVEL'} || $GENERAL::UPGRADE_LEVEL || 50,
    REQUIRED    => "0",

    MAXLENGTH   => "8",
    SIZE        => "30"
  );

  print &Radio (
    TITLE       => "Review Members Account",
    DESCRIPTION => "if you want to review registration information before allowing a user to post on your board. you will be e-mailed every time someone registers. (required mail function enabled)",
    NAME        => "REVIEW_ACCOUNT",
    VALUE       => [
      { VALUE => "1", TITLE => "Yes" },
      { VALUE => "0", TITLE => "No"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'REVIEW_ACCOUNT'} || $GENERAL::REVIEW_ACCOUNT || 0,
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Verify Members Account",
    DESCRIPTION => "if you want to verify the e-mail address to see whether it is valid or not. it will send the password to the registrant to determine this. (required mail function enabled)",
    NAME        => "VERIFY_EMAIL",
    VALUE       => [
      { VALUE => "1", TITLE => "Yes" },
      { VALUE => "0", TITLE => "No"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'VERIFY_EMAIL'} || $GENERAL::VERIFY_EMAIL || 0,
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Nickname Duplicate Check",
    DESCRIPTION => "if you want to check whether a nickname is unique or has been used before on your forum.",
    NAME        => "NICKNAME_DUPLICATE",
    VALUE       => [
      { VALUE => "0", TITLE => "On" },
      { VALUE => "1", TITLE => "Off"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'NICKNAME_DUPLICATE'} || $GENERAL::NICKNAME_DUPLICATE || 0,
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Email Duplicate Check",
    DESCRIPTION => "if you want to check whether an e-mail address is unique or has been used before on your forum.",
    NAME        => "EMAIL_DUPLICATE",
    VALUE       => [
      { VALUE => "0", TITLE => "On" },
      { VALUE => "1", TITLE => "Off"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'EMAIL_DUPLICATE'} || $GENERAL::EMAIL_DUPLICATE || 0,
    REQUIRED    => "0",
  );

  print<<HTML;
<script type="text/javascript" language="JavaScript">
<!--
function uf_add_option(f)
{
  var filter   = f.USERNAME_FILTER;
  var username = f.uf_username;
  var exactly  = f.uf_exactly;
  if (username.value != "") {
    filter.value = filter.value + username.value;
    if (exactly.checked) {
      filter.value = filter.value + ":b";
    }
    filter.value = filter.value + "\|";
  }
  username.value  = "";
  exactly.checked = false;
}
-->
</script>
<tr>
  <td width="200" valign="top" nowrap>Username Filter</td>
  <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan=3><textarea cols="30" rows="3" name="USERNAME_FILTER" style="width:100%" class="TextArea">$GENERAL::USERNAME_FILTER\|</textarea></td>
    </tr>
    <tr>
      <td><input type="button" name="uf_add" value="add" onClick="uf_add_option(this.form)">&nbsp;</td>
      <td width="100%"><input type="text" name="uf_username" style="width:100%"></td>
      <td nowrap><input type="checkbox" name="uf_exactly" value="b">exactly</td>
    </tr>
  </table></td>
  <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="add some words that you don't allow vistors to register. ([b] mean exactly same word appear on username)"></td>
</tr>
HTML

  print<<HTML;
<script type="text/javascript" language="JavaScript">
<!--
function nf_add_option(f)
{
  var filter   = f.NICKNAME_FILTER;
  var nickname = f.nf_nickname;
  var exactly  = f.nf_exactly;
  if (nickname.value != "") {
    filter.value = filter.value + nickname.value;
    if (exactly.checked) {
      filter.value = filter.value + ":b";
    }
    filter.value = filter.value + "\|";
  }
  nickname.value  = "";
  exactly.checked = false;
}
-->
</script>
<tr>
  <td width="200" valign="top" nowrap>Nickname Filter</td>
  <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan=3><textarea cols="30" rows="3" name="NICKNAME_FILTER" style="width:100%" class="TextArea">$GENERAL::NICKNAME_FILTER\|</textarea></td>
    </tr>
    <tr>
      <td><input type="button" name="nf_add" value="add" onClick="nf_add_option(this.form)">&nbsp;</td>
      <td width="100%"><input type="text" name="nf_nickname" style="width:100%"></td>
      <td nowrap><input type="checkbox" name="nf_exactly" value="b">exactly</td>
    </tr>
  </table></td>
  <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="add some words that you don't allow vistors to register. ([b] mean exactly same word appear on nickname)"></td>
</tr>
HTML

  print<<HTML;
<script type="text/javascript" language="JavaScript">
<!--
function ef_add_option(f)
{
  var filter   = f.EMAIL_FILTER;
  var email    = f.ef_email;
  var ef_type     = f.ef_type;
  if (email.value != "") {
    filter.value = filter.value + email.value;
    if (ef_type[1].checked == true) {
      filter.value = filter.value + ":d";
      if (f.ef_d_exactly.checked) {
        filter.value = filter.value + "b";
      }
    } else if (ef_type[2].checked == true) {
      filter.value = filter.value + ":u";
      if (f.ef_u_exactly.checked) {
        filter.value = filter.value + "b";
      }
    }
    filter.value = filter.value + "\|";
  }
  email.value  = "";
  ef_type[0].checked = true;
  f.ef_d_exactly.checked = false;
  f.ef_u_exactly.checked = false;
}
-->
</script>
<tr>
  <td width="200" valign="top" nowrap>Email Filter</td>
  <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan=3><textarea cols="30" rows="3" name="EMAIL_FILTER" style="width:100%" class="TextArea">$GENERAL::EMAIL_FILTER\|</textarea></td>
    </tr>
    <tr>
      <td><input type="button" name="ef_add" value="add" onClick="ef_add_option(this.form)">&nbsp;</td>
      <td width="100%"><input type="text" name="ef_email" style="width:100%"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td width="100%"><input type="radio" name="ef_type" value="" checked>Check the whole email address</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td width="100%"><input type="radio" name="ef_type" value="d">Check domain name only <input type="checkbox" name="ef_d_exactly" value="b">exactly</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td width="100%"><input type="radio" name="ef_type" value="u">Check username only <input type="checkbox" name="ef_u_exactly" value="b">exactly</td>
    </tr>
  </table></td>
  <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="add some words that you don't allow vistors to register. ([d] mean check the domain name part only [u] mean check the usernaem part only [b] mean exactly same word appear)"></td>
</tr>
HTML

  print &Radio (
    TITLE       => "Notify You After Registration",
    DESCRIPTION => "if you want to notified after someone registers an account. (required mail function enabled)",
    NAME        => "NOTIFY_REGISTER",
    VALUE       => [
      { VALUE => "1", TITLE => "Yes" },
      { VALUE => "0", TITLE => "No"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'NOTIFY_REGISTER'} || $GENERAL::NOTIFY_REGISTER || 0,
    REQUIRED    => "0",
  );

  print &TextField (
    TITLE       => "Max Comments Length",
    DESCRIPTION => "the maximum number of characters allowed in the comments field. (Max. 512 chars)",
    NAME        => "MAX_COMMENTS_LENGTH",
    VALUE       => $UB::QUERY{'MAX_COMMENTS_LENGTH'} || $GENERAL::MAX_COMMENTS_LENGTH || 256,
    REQUIRED    => "0",

    MAXLENGTH   => "8",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Max Signature Length",
    DESCRIPTION => "the maximum number of characters allowed in the signature field. (Max. 512 chars)",
    NAME        => "MAX_SIGNATURE_LENGTH",
    VALUE       => $UB::QUERY{'MAX_SIGNATURE_LENGTH'} || $GENERAL::MAX_SIGNATURE_LENGTH || 256,
    REQUIRED    => "0",

    MAXLENGTH   => "8",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Max Photo Size",
    DESCRIPTION => "maximum photo size (in kilobytes) that member can upload.",
    NAME        => "MAX_PHOTO_LENGTH",
    VALUE       => $UB::QUERY{'MAX_PHOTO_LENGTH'} || $GENERAL::MAX_PHOTO_LENGTH || 10,
    REQUIRED    => "0",

    MAXLENGTH   => "4",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Max Photo Width Size",
    DESCRIPTION => "maximum photo width size.",
    NAME        => "MAX_PHOTO_X",
    VALUE       => $UB::QUERY{'MAX_PHOTO_X'} || $GENERAL::MAX_PHOTO_X || 20,
    REQUIRED    => "0",

    MAXLENGTH   => "3",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Max Photo Height Size",
    DESCRIPTION => "maximum photo height size.",
    NAME        => "MAX_PHOTO_Y",
    VALUE       => $UB::QUERY{'MAX_PHOTO_Y'} || $GENERAL::MAX_PHOTO_Y || 20,
    REQUIRED    => "0",

    MAXLENGTH   => "3",
    SIZE        => "30"
  );

print<<HTML;
   </table>
  </td>
 </tr>
</table>
HTML

print<<HTML;
&nbsp;<br>
&nbsp;&nbsp;Posting Options
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
 <tr>
  <td>
   <table width="100%" border="0" cellspacing="0" cellpadding="2">
HTML

  print &Radio (
    TITLE       => "Notification of Posing",
    DESCRIPTION => "if you want to be notified every time someone posts a topic/reply. (required mail function enabled)",
    NAME        => "NOTIFY_POST",
    VALUE       => [
      { VALUE => "1", TITLE => "Yes, notify me." },
      { VALUE => "0", TITLE => "No, don't notify me."}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'NOTIFY_POST'} || $GENERAL::NOTIFY_POST || 0,
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Display Notification on Posting",
    DESCRIPTION => "display notification option during posting topic. (required mail function enabled)",
    NAME        => "NOTIFY_MEMBER_POST",
    VALUE       => [
      { VALUE => "1", TITLE => "On" },
      { VALUE => "0", TITLE => "Off"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'NOTIFY_MEMBER_POST'} || $GENERAL::NOTIFY_MEMBER_POST || 0,
    REQUIRED    => "0",
  );

  print &TextField (
    TITLE       => "Max Subject Length",
    DESCRIPTION => "the maximum number of characters allowed in the subject field.",
    NAME        => "MAX_SUBJECT_LENGTH",
    VALUE       => $UB::QUERY{'MAX_SUBJECT_LENGTH'} || $GENERAL::MAX_SUBJECT_LENGTH || 64,
    REQUIRED    => "0",

    MAXLENGTH   => "8",
    SIZE        => "30"
  );

  print &TextField (
    TITLE       => "Max Message Length",
    DESCRIPTION => "the maximum number of characters allowed in the message field.",
    NAME        => "MAX_MESSAGE_LENGTH",
    VALUE       => $UB::QUERY{'MAX_MESSAGE_LENGTH'} || $GENERAL::MAX_MESSAGE_LENGTH || 1024,
    REQUIRED    => "0",

    MAXLENGTH   => "8",
    SIZE        => "30"
  );

  print &Radio (
    TITLE       => "Use Message Icons",
    DESCRIPTION => "if you allow your members use ultraboard message icons on their message.",
    NAME        => "MESSAGE_ICONS",
    VALUE       => [
      { VALUE => "1", TITLE => "Yes" },
      { VALUE => "0", TITLE => "No"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'MESSAGE_ICONS'} || $GENERAL::MESSAGE_ICONS || 0,
    REQUIRED    => "0",
  );

  print &Radio (
    TITLE       => "Display IP/Host",
    DESCRIPTION => "if you want to display the ip/host of each post.",
    NAME        => "SHOW_IP_HOST",
    VALUE       => [
      { VALUE => "1", TITLE => "Yes" },
      { VALUE => "0", TITLE => "No"}
    ],
    WRAP        => 0,
    SELECT      => $UB::QUERY{'SHOW_IP_HOST'} || $GENERAL::SHOW_IP_HOST || 0,
    REQUIRED    => "0",
  );

  my $ATTACH_TYPE = join ("\n", @GENERAL::ATTACH_TYPE);;

  print &TextArea (
    TITLE       => "Accepted MIME Type",
    DESCRIPTION => "what type of attachment that you allow to upload? (seperate by new line)",
    NAME        => "ATTACH_TYPE",
    VALUE       => $UB::QUERY{'OFFLINE_MESSAGE'} || $ATTACH_TYPE,
    REQUIRED    => "0",

    COLS        => "30",
    ROWS        => "5"
  );

print<<HTML;
   </table>
  </td>
 </tr>
</table>
HTML

print<<HTML;
          </td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td align="right"><input type="submit" value="Update it">&nbsp;&nbsp;<input type="Reset" value="Cancel"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form>
</body>
</html>
HTML
}

###############################################################################
1; # end of CP_CfgGeneral.src file
###############################################################################