# FILE: src-board-subs-12
# Options Manager & Version Manager
#-------------------------------------------------------------------------------
# DISCUS VERSION 3.10 COPYRIGHT NOTICE
#
# Discus 3.10 is copyright (c) 2000 by DiscusWare, LLC, all rights reserved.
# The use of Discus is governed by the Discus License Agreement which is
# available from the Discus WWW site at:
#    http://www.discusware.com/discus/license
#
# Pursuant to the Discus License Agreement, this copyright notice may not be
# removed or altered in any way.
#-------------------------------------------------------------------------------

#---SEPARATOR---#
#REQ:ip_ban_form

sub options_mgr {
	&header;
	print "<HTML><HEAD><TITLE>Options Manager</TITLE>\n";
	print '<BODY BGCOLOR="ffffff" TEXT="000000" LINK="0000FF" VLINK="0000FF" ';
	print "onLoad=\"window.defaultStatus = 'Options Manager'\">$fs\n";
	print "<FONT SIZE=3><CENTER><B>Options Manager</B></CENTER></FONT>\n";
	print "<HR>\n";
	print "This screen allows you to set several parameters that apply to the\n";
	print "<I>entire board</I>.  To make a change effective, you must click the\n";
	print "&quot;Save Options&quot; button at the bottom of this page.<P>\n";
	print "<FORM ACTION=$cgiurl METHOD=POST>\n";
	print "<INPUT NAME=action TYPE=HIDDEN VALUE=options_save>\n";
	print "<INPUT NAME=options_used TYPE=HIDDEN VALUE=1>\n";
	print "<INPUT NAME=username TYPE=HIDDEN VALUE=$superuser>\n";
	print "<TABLE BGCOLOR=#ffffcc BORDER=1 WIDTH=100%><TR><TD>$fs";
	print "<B>Activation of Scripts</B>\n";
	print "<BLOCKQUOTE>\n";
	print "<INPUT TYPE=CHECKBOX NAME=admin VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'admin'};
	print "> Administration enabled<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=email VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'email'};
	print " onClick=\"if (document.forms[0].capable.checked == false) { alert('E-mail notification can be enabled only if your server is capable of sending e-mail messages.  You must check the option below next to:\\n\\nServer is capable of sending e-mail messages\\n\\n...before you can enable e-mail notification.'); document.forms[0].email.checked = 0; }\"";
	print "> E-mail notification enabled";
	print "<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=maintenance VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'maintenance'};
	print "> ";
	if ($GLOBAL_OPTIONS{'maintenance'}) {
		print "<BLINK><FONT COLOR=#ff0000><B>Maintenance Mode Enabled</B></FONT></BLINK><BR>\n";
	} else {
		print "Maintenance Mode<BR>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=posting VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'posting'};
	print "> Posting enabled<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=capable VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'capable'};
	print " CHECKED" if ($GLOBAL_OPTIONS{'email'} == 1 && $GLOBAL_OPTIONS{'capable'} eq "");
	print " onClick=\"if (document.forms[0].capable.checked == false) { if (document.forms[0].email.checked == true) { document.forms[0].email.checked = false; alert('Because you have specified that this server is not capable of sending e-mail messages, e-mail notification has been automatically disabled.'); } } \"";
	print "> Server is capable of sending e-mail messages";
	print " (<A HREF=\"$cgiurlm?username=$FORM{'username'}&cmd=email_configurator\" onMouseOver=\"window.status = 'Configure e-mail parameters on this server'; return true\">Configure</A>)";
	print "<BR>\n";
	if ($pro) {
		print "<INPUT TYPE=CHECKBOX NAME=allow_selfreg VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'allow_selfreg'};
		print "> User self-registration enabled (<A HREF=\"$cgiurlm?username=$FORM{'username'}&cmd=reg_configurator\" onMouseOver=\"window.status = 'Configure which e-mail domains are banned'; return true\">Configure</A>)<BR>\n";
	}
	print "</BLOCKQUOTE>\n";
	print "<B>Contact Information</B>\n";
	print "<BLOCKQUOTE>\n";
	print "This is for the &quot;Please address general questions and concerns to <U><FONT COLOR=#0000ff><I>person</I></FONT></U>\" message.<P>\n";
	print "<TABLE><TR><TD>$fs";
	print "Contact name:</TD><TD><INPUT TYPE=TEXT NAME=admin_contact_name SIZE=35 VALUE=\"";
	if ($GLOBAL_OPTIONS{'admin_contact_name'} ne "" && $GLOBAL_OPTIONS{'admin_contact_name'} ne "0") {
		print $GLOBAL_OPTIONS{'admin_contact_name'};
	} else {
		if ($contact =~ m|<A HREF="?([^">]+)"?>(.*)</A>|) {
			print $2;
		}
	}
	print "\"></TD></TR>\n";
	print "<TR><TD>$fs", "Contact e-mail:</TD><TD><INPUT TYPE=TEXT NAME=admin_contact_email SIZE=35 VALUE=\"";
	if ($GLOBAL_OPTIONS{'admin_contact_email'} ne "" && $GLOBAL_OPTIONS{'admin_contact_email'} ne "0") {
		print $GLOBAL_OPTIONS{'admin_contact_email'};
	} else {
		if ($contact =~ m|<A HREF="?([^">]+)"?>(.*)</A>|) {
			$x = $1; $x =~ s/^mailto://g; print $x;
		}
	}
	print "\"></TD></TR></TABLE><P>\n";
	print "</BLOCKQUOTE>\n";
	print "<B>Conversation/Message Options</B>\n";
	print "<BLOCKQUOTE>\n";
	print "<INPUT TYPE=CHECKBOX NAME=active_links VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'active_links'};
	print "> Activate URLs and e-mail addresses in posts<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=allow_arb_html VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'allow_arb_html'};
	print "> Allow arbitrary HTML in posts (strongly discouraged -- read instructions)<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=anonymous VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'anonymous'};
	print "> Allow posts as &quot;Anonymous&quot;<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=allow_email_url VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'allow_email_url'};
	print "> Allow URLs to be entered in e-mail address box<BR>";
	print "<INPUT TYPE=HIDDEN NAME=alternating VALUE=1>";
	print "<INPUT TYPE=CHECKBOX CHECKED> Alternating colors defined:\n";
	print "<UL><TABLE BORDER=0><TR><TD>$fs";
	print "ID&nbsp;&nbsp;</TD><TD>$fs", "&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD>$fs", "Color</TD>\n";
	print "<TD>&nbsp;&nbsp;</TD><TD>$fs", "ID&nbsp;&nbsp;</TD><TD>$fs", "&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD>$fs", "Color</TD>\n";
	print "</TR>\n";
	for ($c = 1; $c <= 5; $c++) {
		$d = 5 + $c;
		print "<TR><TD ALIGN=CENTER>$fs$c</TD><TD ";
		if ($GLOBAL_OPTIONS{"alt_color_$c"}) {
			print "BGCOLOR=", $GLOBAL_OPTIONS{"alt_color_$c"};
		}
		print ">&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD><INPUT TYPE=TEXT NAME=alt_color_$c VALUE='";
		print $GLOBAL_OPTIONS{"alt_color_$c"};
		print "' SIZE=7></TD>\n";
		print "<TD>&nbsp;&nbsp;</TD><TD ALIGN=CENTER>$fs$d</TD><TD ";
		if ($GLOBAL_OPTIONS{"alt_color_$d"}) {
			print "BGCOLOR=", $GLOBAL_OPTIONS{"alt_color_$d"};
		}
		print ">&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD><INPUT TYPE=TEXT NAME=alt_color_$d VALUE='";
		print $GLOBAL_OPTIONS{"alt_color_$d"};
		print "' SIZE=7></TD>\n";
		print "</TR>\n";

	}
	print "</TABLE></UL>\n";
	print "<INPUT TYPE=CHECKBOX NAME=capitalize VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'capitalize'};
	print "> Capitalize first letter in user-created subject lines<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=capitalize_username VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'capitalize_username'} == 1|| $GLOBAL_OPTIONS{'capitalize_username'} eq "");
	print "> Capitalize first letter in usernames<BR>";
	if (!$pro) {
		print "<INPUT TYPE=CHECKBOX NAME=cookies VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'cookies'};
		print "> Cookie option - remember username/password in cookies<BR>";
	}
	print "<INPUT TYPE=CHECKBOX NAME=new_conv_with_add VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'new_conv_with_add'} eq "" || $GLOBAL_OPTIONS{'new_conv_with_add'} == 1);
	print "> Create pages in user interface with &quot;Add a Message&quot; box<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=new_conv_with_button VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'new_conv_with_button'};
	print "> Create pages in user interface with &quot;Create New Conversation&quot; button<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=double_post VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'double_post'};
	print "> Double post protection (prevents duplicate postings)<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=email_on_post VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'email_on_post'};
	if (!$pro) {
		print "> E-mail addresses on posts<BR>";
	} else {
		print "> E-mail addresses/links to profile on posts<BR>";
	}
	print "<INPUT TYPE=CHECKBOX NAME=fullnames VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'fullnames'};
	print "> Full names on posts<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=message_icons VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'message_icons'};
	$GLOBAL_OPTIONS{'link_icon_filename'} = "tree_m.gif" if $GLOBAL_OPTIONS{'link_icon_filename'} eq "";
	print "> Icons (<IMG SRC=$html_url/icons/mark_up.gif><IMG SRC=$html_url/icons/mark_down.gif>) by posts";
	if ($GLOBAL_OPTIONS{'message_icons'}) {
		$fl = 0;
		$fl = 1 if !($GLOBAL_OPTIONS{'message_icon_top'} || $GLOBAL_OPTIONS{'message_icon_up'} || $GLOBAL_OPTIONS{'message_icon_down'} || $GLOBAL_OPTIONS{'message_icon_bottom'} || $GLOBAL_OPTIONS{'message_icon_link'});
		print "<UL>\n";
		print "<TABLE>\n";
		print "<TR><TD>$fs", "Top icon:</TD><TD><INPUT TYPE=TEXT NAME=message_icon_top VALUE='";
		print $GLOBAL_OPTIONS{'message_icon_top'} if $GLOBAL_OPTIONS{'message_icon_top'};
		print "mark_top.gif" if $fl == 1;
		print "' SIZE=20></TD></TR>\n";
		print "<TR><TD>$fs", "Up icon:</TD><TD><INPUT TYPE=TEXT NAME=message_icon_up VALUE='";
		print $GLOBAL_OPTIONS{'message_icon_up'} if $GLOBAL_OPTIONS{'message_icon_up'};
		print "mark_up.gif" if $fl == 1;
		print "' SIZE=20></TD></TR>\n";
		print "<TR><TD>$fs", "Down icon:</TD><TD><INPUT TYPE=TEXT NAME=message_icon_down VALUE='";
		print $GLOBAL_OPTIONS{'message_icon_down'} if $GLOBAL_OPTIONS{'message_icon_down'};
		print "mark_down.gif" if $fl == 1;
		print "' SIZE=20></TD></TR>\n";
		print "<TR><TD>$fs", "Bottom icon:</TD><TD><INPUT TYPE=TEXT NAME=message_icon_bottom VALUE='";
		print $GLOBAL_OPTIONS{'message_icon_bottom'} if $GLOBAL_OPTIONS{'message_icon_bottom'};
		print "mark_bottom.gif" if $fl == 1;
		print "' SIZE=20></TD></TR>\n";
		print "<TR><TD>$fs", "Link icon:</TD><TD><INPUT TYPE=TEXT NAME=message_icon_link VALUE='";
		print $GLOBAL_OPTIONS{'message_icon_link'} if $GLOBAL_OPTIONS{'message_icon_link'};
		print "tree_m.gif" if $fl == 1;
		print "' SIZE=20></TD></TR></TABLE></UL>\n";
	} else {
		print "<INPUT TYPE=HIDDEN NAME=message_icon_top VALUE='$GLOBAL_OPTIONS{'message_icon_top'}'>\n";
		print "<INPUT TYPE=HIDDEN NAME=message_icon_up VALUE='$GLOBAL_OPTIONS{'message_icon_up'}'>\n";
		print "<INPUT TYPE=HIDDEN NAME=message_icon_down VALUE='$GLOBAL_OPTIONS{'message_icon_down'}'>\n";
		print "<INPUT TYPE=HIDDEN NAME=message_icon_bottom VALUE='$GLOBAL_OPTIONS{'message_icon_bottom'}'>\n";
		print "<INPUT TYPE=HIDDEN NAME=message_icon_link VALUE='$GLOBAL_OPTIONS{'message_icon_link'}'>\n";
		print "<BR>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=ip_on_post VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'ip_on_post'};
	print "> IP addresses on posts<BR>";
	print "<INPUT TYPE=CHECKBOX NAME=noload_warning VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'noload_warning'};
	print "> Issue warning JavaScript box if post preview page didn't load entirely<BR>\n";
	if ($pro) {
		print "<INPUT TYPE=CHECKBOX NAME=moderator_turn_off_email VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'moderator_turn_off_email'};
		print "> Moderators can disable e-mail notification for a given post<BR>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=html VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'html'};
	print "> Perform HTML to formatting tag conversion<BR>\n";
	if ($pro) {
		print "<INPUT TYPE=CHECKBOX NAME=RTF VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'RTF'};
		print "> Perform RTF to formatting tag conversion<BR>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=profanity VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'profanity'};
	print "> Profanity checker (<A HREF=$cgiurlm?username=$superuser&cmd=profanity_editor onMouseOver=\"window.status = 'Edit the list of words considered to be profanity on this board'; return true\">Edit word list</A>)<BR>\n";
	if ($GLOBAL_OPTIONS{'profanity'}) {
		print "<UL>If profanity is detected:<P>\n";
		print "<INPUT TYPE=RADIO NAME=profanity_detected VALUE=1 ";
		print "CHECKED" if ($GLOBAL_OPTIONS{'profanity_detected'} == 1 || $GLOBAL_OPTIONS{'profanity_detected'} eq "");
		print "> Change profanity to <FONT COLOR=#ff0000><B>&#149;&#149;&#149;&#149;</B></FONT> (dots)<BR>\n";
		print "<INPUT TYPE=RADIO NAME=profanity_detected VALUE=2 ";
		print "CHECKED" if ($GLOBAL_OPTIONS{'profanity_detected'} == 2);
		print "> Do not allow post to be submitted<BR>\n";
		print "</UL>\n";
	} else {
		print "<INPUT TYPE=HIDDEN NAME=profanity_detected VALUE='$GLOBAL_OPTIONS{'profanity_detected'}'>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=send_mail_only_admins VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'send_mail_only_admins'};
	print "> Send e-mail notification only to moderators<BR>\n";
	if ($spellchecker_net_feature_on) {
		print "<INPUT TYPE=CHECKBOX NAME=spellchecker VALUE=1";
		print " CHECKED" if ($GLOBAL_OPTIONS{'spellchecker'} eq "1" || $GLOBAL_OPTIONS{'spellchecker'} eq "");
		print "> Spell checker button (www.spellchecker.net)<BR>\n";
		if ($GLOBAL_OPTIONS{'spellchecker'} eq "1" || $GLOBAL_OPTIONS{'spellchecker'} eq "") {
			print "<UL>\n";
			print "Language:\n";
			undef %Ll;
			$Ll{'zzother'} = "*Another Language*";
			$Ll{'en'} = "English";
			$Ll{'fr'} = "French";
			$Ll{'ge'} = "German";
			$Ll{'it'} = "Italian";
			$Ll{'sp'} = "Spanish";
			$Ll{'dk'} = "Danish";
			$Ll{'br'} = "Brazilian Portuguese";
			$Ll{'nl'} = "Dutch";
			$Ll{'no'} = "Norwegian";
			$Ll{'pt'} = "Portuguese";
			$Ll{'se'} = "Swedish";
			$Ll{'fi'} = "Finnish";
			$LI{'uk'} = "British English";
			print "<SELECT NAME=spellchecker_language SIZE=1";
			print " onChange=\"if (document.forms[0].selectedIndex != ";
			print (scalar(keys(%Ll))-2);
			print ") { document.forms[0].otherdict.value = ''; }\"\n";
			foreach $Ll (sort keys(%Ll)) {
				print "<OPTION VALUE=\"$Ll\"";
				print " SELECTED" if $GLOBAL_OPTIONS{'spellchecker_language'} eq $Ll;
				print " SELECTED" if (($GLOBAL_OPTIONS{'spellchecker_language'} eq "" || $GLOBAL_OPTIONS{'spellchecker_language'} eq "0") && $Ll eq "en");
				print " SELECTED" if ($GLOBAL_OPTIONS{'spellchecker_language'} =~ m|^\*| && $Ll eq "zzother");
				print "> $Ll{$Ll}\n";
			}
			print "</SELECT><P>\n";
			print "If your language is not on the list above, but you wish to use another dictionary\n";
			print "available from www.spellchecker.net, please enter the appropriate language code.<P>\n";
			print "<FONT SIZE=1>Technical Note: What you enter here will replace the &lt;#LANGUAGE#&gt;\n";
			print "directive as documented by www.spellchecker.net.</FONT><P>\n";
			print "Alternate Dictionary Code: </FONT><INPUT TYPE=TEXT NAME=otherdict VALUE=\"";
			if ($GLOBAL_OPTIONS{'spellchecker_language'} =~ m|^\*|) {
				print $';
			}
			print "\" SIZE=5 onChange=\"if (document.forms[0].otherdict.value != '') {document.forms[0].spellchecker_language.selectedIndex = ";
			print (scalar(keys(%Ll))-2);
			print "; }\">\n";
			print "$fs<P>\n";
			print "If you have been assigned a customer ID from www.spellchecker.net, enter this customer ID\n";
			print "here.  Just leave this blank if you have not been assigned your own customer ID (the service\n";
			print "will function properly with no customer ID entered; it may not work if an incorrect customer\n";
			print "ID is entered).<P>\n";
			print "Assigned Customer ID: </FONT><INPUT TYPE=TEXT NAME=spellcheck_custid VALUE=\"";
			if ($GLOBAL_OPTIONS{'spellcheck_custid'} eq "0" || $GLOBAL_OPTIONS{'spellcheck_custid'} eq "") {
				print "";
			} else {
				print $GLOBAL_OPTIONS{'spellcheck_custid'};
			}
			print "\" SIZE=15>$fs<P>\n";
			print "</UL>\n";
		}
	}
	print "<INPUT TYPE=CHECKBOX NAME=user_paren VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'user_paren'} == 1 || $GLOBAL_OPTIONS{'user_paren'} eq "");
	print "> Username in (parentheses) on posts<BR>\n";
	if ($pro) {
		print "<INPUT TYPE=CHECKBOX NAME=usersedit VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'usersedit'};
		print "> Users may edit their own posts within ";
		print "<INPUT TYPE=TEXT SIZE=3 NAME=usersedit_time VALUE='";
		if ($GLOBAL_OPTIONS{'usersedit_time'} == 0) {
			print "0";
		} else {
			print $GLOBAL_OPTIONS{'usersedit_time'};
		}
		print "'> minutes<BR>\n";
		print "&nbsp;" x 5;
		print "<INPUT TYPE=CHECKBOX NAME=disable_if_queued VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'disable_if_queued'};
		print "> Disable editing if topic requires moderator approval of user's posts\n";

	}
	print "</BLOCKQUOTE>\n";
	print "<B>General, Miscellaneous Options</B>\n";
	print "<BLOCKQUOTE>\n";
	print "<INPUT TYPE=CHECKBOX NAME=admin_login_history VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'admin_login_history'} == 1 || $GLOBAL_OPTIONS{'admin_login_history'} eq "");
	print "> Administration: Display moderator login history<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=admin_actionlog VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'admin_actionlog'} == 1);
	print "> Administration: Log actions of board moderators<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=version_notice_no VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'version_notice_no'} eq "" || $GLOBAL_OPTIONS{'version_notice_no'} == 1);
	print "> Administration: Display version message in main menu<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=fast_index VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'fast_index'} == 1);
	print "> Board Regeneration: Use faster indexing (no gauge)<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=dates_zero VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'dates_zero'} == 1 || $GLOBAL_OPTIONS{'dates_zero'} eq "");
	print "> Dates: Place a &quot;0&quot; in front of months and days less than 10<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=diskquota_disable VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'diskquota_disable'} == 1 || $GLOBAL_OPTIONS{'diskquota_disable'} eq "");
	print "> Disk quota checking: Disable board immediately if quota problem detected<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=quota_check_off VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'quota_check_off'} == 1);
	print " onClick=\"if (document.forms[0].quota_check_off.checked == true) { document.forms[0].quota_check_off.checked = confirm('DiscusWare strongly suggests that you leave this option unchecked unless you have read the administration instructions and thoroughly understand the issues involved.  Click OK to check this box or Cancel to uncheck it (recommended).'); };\"";
	print "> Disk quota checking: Disable file size verifications (not recommended)<BR>\n";
	if (open (CFG, "$admin_dir/email.txt")) {
		@cfg = <CFG>;
		close (CFG);
		if (grep(/^reply_email=1/, @cfg)) {
			$reply_by_email = 1;
		} else {
			$reply_by_email = 0;
		}
	}
	if ($reply_by_email == 1) {
		print "<INPUT TYPE=CHECKBOX NAME=link_first VALUE=1";
		print " CHECKED" if ($GLOBAL_OPTIONS{'link_first'} == 1);
		print "> E-mail notification: Put link to discussion prior to reply form<BR>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=lockerror_disable VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'lockerror_disable'} == 1 || $GLOBAL_OPTIONS{'lockerror_disable'} eq "");
	print "> File Locking: Disable board if file locking does not work properly<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=lock_with_file VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'lock_with_file'} == 1);
	print "> File Locking: Use file-based locking instead of directory-based locking<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=check_message_source VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'check_message_source'} == 1;
	print "> Image Upload: Check message source for validity<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=image_referer VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'image_referer'} == 1 || $GLOBAL_OPTIONS{'image_referer'} eq "");
	print "> Image Upload: Check referring page for validity<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=nosource VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'nosource'} == 1);
	print "> Message Source: Do not store message source (read instructions!)<BR>\n ";
	print "<INPUT TYPE=CHECKBOX NAME=alternate_topic_navbar VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'alternate_topic_navbar'} == 1;
	print "> Navigation Bar: Use alternate URL for topics page:<BR>\n";
	print "&nbsp;" x 5;
	print "</FONT><FONT SIZE=2><INPUT TYPE=TEXT NAME=alternate_topic_navbar_url VALUE=\"$GLOBAL_OPTIONS{'alternate_topic_navbar_url'}\" SIZE=45></FONT><BR>\n$fs";
	print "<INPUT TYPE=CHECKBOX NAME=name_length_limit VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'name_length_limit'} == 1 || $GLOBAL_OPTIONS{'name_length_limit'} eq "");
	print "> Profiles: Limit length of full name to ";
	print "<INPUT TYPE=TEXT NAME=name_length_limit_number SIZE=3 VALUE=\"";
	print $GLOBAL_OPTIONS{'name_length_limit_number'} if $GLOBAL_OPTIONS{'name_length_limit_number'} > 0;
	print "35" if $GLOBAL_OPTIONS{'name_length_limit_number'} == 0;
	print "\"> characters<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=search_ipverify VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'search_ipverify'} == 1);
	print "> Search Engine: Do not verify IP address upon searches<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=search_stopwords VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'search_stopwords'} == 1 || $GLOBAL_OPTIONS{'search_stopwords'} eq "");
	print "> Search Engine: Use &quot;Stop Words&quot; to create smaller index files<BR>\n";

	if ($pro && $checkoptions_tester) {
# This feature is being evaluated for a future version of the software
# To test, enter "checkoptions_tester=1" in your discus.conf file
# This should be considered BETA quality regardless of the version number
# of Discus 3.1x.  Please send feedback and bug reports to us at
# discus@discusware.com -- thanks for your support!
		print "<INPUT TYPE=CHECKBOX NAME=similar_check VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'similar_check'} == 1;
		print "> Security in posting: Disallow public posters from impersonating actual users<BR>\n";
		print "<BLOCKQUOTE>Choose your level of security:<P>\n";
		print "<INPUT TYPE=RADIO NAME=similar_check_config VALUE=0";
		print " CHECKED" if $GLOBAL_OPTIONS{'similar_check_config'} == 0;
		print "> Low: Deny exact matches of registered name or username<BR>\n";
# Leaving some room for options between these two extremes.
# Comments welcome -- discus@discusware.com!
		print "<INPUT TYPE=RADIO NAME=similar_check_config VALUE=4";
		print " CHECKED" if $GLOBAL_OPTIONS{'similar_check_config'} == 4;
		print "> Moderate: Deny exact matches of the user's last name<BR>\n";
		print "<INPUT TYPE=RADIO NAME=similar_check_config VALUE=7";
		print " CHECKED" if $GLOBAL_OPTIONS{'similar_check_config'} == 7;
		print "> Tight: Deny matches of over 50% of a user's last name<BR>\n";
		print "<INPUT TYPE=CHECKBOX NAME=similar_check_override VALUE=1";
		print " CHECKED" if ($GLOBAL_OPTIONS{'similar_check_override'} == 1 || $GLOBAL_OPTIONS{'similar_check_override'} eq "");
		print "> Compare only last names (strongly recommended)\n";
		print "<P>When a post is rejected, show the following message:\n";
		print "<P><INPUT TYPE=RADIO NAME=similar_check_error VALUE=0";
		print " CHECKED" if $GLOBAL_OPTIONS{'similar_check_error'} == 0;
		print "> Standard 'Authentication Error' message<BR>\n";
		print "<INPUT TYPE=RADIO NAME=similar_check_error VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'similar_check_error'} == 1;
		print "> The following text message (use HTML for formatting if desired):<BR>\n";
		print "<TABLE><TR><TD><TEXTAREA NAME=custom_message ROWS=3 COLS=50 WRAP=VIRTUAL>";
		print $GLOBAL_OPTIONS{'custom_message'};
		print "</TEXTAREA></TD></TR></TABLE><P>\n";
		print "</BLOCKQUOTE>\n";
	}
	if ($pro) {
		print "<INPUT TYPE=CHECKBOX NAME=skip_archives_nm VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{"skip_archives_nm"};
		print "> Skip archives in &quot;New Messages&quot; searches<BR>\n";
		print "<INPUT TYPE=CHECKBOX NAME=skip_archives_tree VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{"skip_archives_tree"};
		print "> Skip archives in &quot;Tree View&quot;<BR>\n";
		print "<INPUT TYPE=CHECKBOX NAME=dictionary_not_alphabetical VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{"dictionary_not_alphabetical"};
		print "> Spell Checker: Dictionary files not in alphabetical order<BR>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=no_style_on_topics VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'no_style_on_topics'} == 1;
	print "> Topics Page: Do not print CSS style definitions of &lt;P class=desc&gt; tag<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=top_page_noregen VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'top_page_noregen'} == 1;
	print "> Topics Page: Do not update when posting messages, etc.<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=SHOW_LAST_TIME VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'SHOW_LAST_TIME'} == 1;
	print "> User Manager: Show &quot;Last Logged In&quot; to moderators<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=redstar VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'redstar'} == 1;
	print "> User Manager: Show <FONT COLOR=#ff0000>*</FONT> for users who have never logged in<BR>\n";
	if ($pro) {
		print "<INPUT TYPE=CHECKBOX NAME=user_picts VALUE=1";
		print " CHECKED" if ($GLOBAL_OPTIONS{'user_picts'} == 1 || $GLOBAL_OPTIONS{'user_picts'} eq "");
		print "> User Profiles: Picture upload enabled<BR>\n";
	}
	print "<INPUT TYPE=CHECKBOX NAME=pwchange VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'pwchange'} == 1 || $GLOBAL_OPTIONS{'pwchange'} eq "");
	print "> User Profiles: Users may change their passwords<BR>\n";
	if ($pro) {
		print "<INPUT TYPE=CHECKBOX NAME=allow_register_same_email VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'allow_register_same_email'} == 1;
		print "> User Self-Registration: Allow registration with an already used e-mail address<BR>\n";
		print "<INPUT TYPE=CHECKBOX NAME=emchange VALUE=1";
		print " CHECKED" if $GLOBAL_OPTIONS{'emchange'} == 1;
		print "> User Self-Registration: Allow self-registered users to change their e-mail address<BR>\n";
		print "<INPUT TYPE=CHECKBOX NAME=require_valid_email VALUE=1";
		print " CHECKED" if ($GLOBAL_OPTIONS{'require_valid_email'} == 1 || $GLOBAL_OPTIONS{'require_valid_email'} eq "");
		print "> User Self-Registration: Require an e-mail address to be entered upon registration<BR>\n";
	}
	print "<BR>Reindexing factor: <INPUT TYPE=TEXT NAME=reindex_factor VALUE=";
	print "\"$GLOBAL_OPTIONS{'reindex_factor'}\"" if $GLOBAL_OPTIONS{'reindex_factor'};
	print "\"15\"" if !$GLOBAL_OPTIONS{'reindex_factor'};
	print " SIZE=4> (read administration instructions before modifying!)<BR>\n";
	print "Template Manager: Use text box with <INPUT TYPE=TEXT NAME=templ_box_cols VALUE=";
	print "\"$GLOBAL_OPTIONS{'templ_box_cols'}\"" if $GLOBAL_OPTIONS{'templ_box_cols'};
	print "\"75\"" if !$GLOBAL_OPTIONS{'templ_box_cols'};
	print " SIZE=2> columns and <INPUT TYPE=TEXT NAME=templ_box_rows VALUE=";
	print "\"$GLOBAL_OPTIONS{'templ_box_rows'}\"" if $GLOBAL_OPTIONS{'templ_box_rows'};
	print "\"20\"" if !$GLOBAL_OPTIONS{'templ_box_rows'};
	print " SIZE=2> rows.<BR>\n";
	print "</BLOCKQUOTE>\n";
	print "<B>Image";
	print " and Attachment" if $pro;
	print " Uploading Options</B>\n";
	print "<BLOCKQUOTE>\n";
	print "<INPUT TYPE=CHECKBOX NAME=images VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'images'};
	print "> Image uploading";
	print " and attachment uploading" if $pro;
	print " enabled<P>\n";
	print "File size limits: (a value of \"0\" indicates <I>no limit</I>,\n";
	print "and a value of \"-1\" disables uploads)<P><BLOCKQUOTE>\n";
	print "</FONT><INPUT TYPE=TEXT NAME=public_maxsize SIZE=5";
	if ($GLOBAL_OPTIONS{'public_maxsize'}) {
		print " VALUE=\"$GLOBAL_OPTIONS{'public_maxsize'}\">\n";
	} else {
		print " VALUE=0>\n";
	}
	print "$fs kb for public posters<BR>\n";
	print "</FONT><INPUT TYPE=TEXT NAME=registered_maxsize SIZE=5";
	if ($GLOBAL_OPTIONS{'registered_maxsize'}) {
		print " VALUE=\"$GLOBAL_OPTIONS{'registered_maxsize'}\">\n";
	} else {
		print " VALUE=0>\n";
	}
	print "$fs kb for registered users<BR>\n";
	print "</FONT><INPUT TYPE=TEXT NAME=registered_mod_maxsize SIZE=5";
	if ($GLOBAL_OPTIONS{'registered_mod_maxsize'}) {
		print " VALUE=\"$GLOBAL_OPTIONS{'registered_mod_maxsize'}\">\n";
	} else {
		print " VALUE=0>\n";
	}
	print "$fs kb for moderators<P>\n";
	print "</BLOCKQUOTE></BLOCKQUOTE>\n";
	print "<B>International Character Set</B>\n";
	print "<BLOCKQUOTE>If you need to specify a special international character set on all of the pages generated\n";
	print "by the Discus Program, you can enter that information here.  If you leave this blank, no character set\n";
	print "information will be written onto the page.  For example, to use the &quot;us-en&quot; character set,\n";
	print "you would type <B>us-en</B> into the blank below.\n";
	print "<P>\n";
	print "<FONT SIZE=1>&lt;META http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=&quot;";
	print "</FONT></FONT>\n";
	print "<INPUT TYPE=TEXT NAME=charset SIZE=20 VALUE=\"";
	print $GLOBAL_OPTIONS{'charset'} if $GLOBAL_OPTIONS{'charset'};
	print "\">$fs<FONT SIZE=1>&quot;&gt;</FONT></BLOCKQUOTE>\n";
	if ($pro) {
		&ip_ban_form;
		print "<B>Log Analysis Configuration</B>\n";
		print "<BLOCKQUOTE>The Log Analysis tool allows analysis of the server's access log\n";
		print "to determine &quot;reads&quot; of pages.  You must specify the name of your\n";
		print "<B>primary log file</B> if you wish to analyze the access log.  If you don't\n";
		print "know where your server's primary log file is, ask your server administrator.\n";
		print "If your server\n";
		print "stores additional old log files, you can also specify those file names.<P>\n";
		$g = $GLOBAL_OPTIONS{'access_log'};
		if ($g ne "" && $g ne "0") {
			$g =~ s/\\/\//g;
			if ($g !~ m|^([\w\-\.\+\/\:]+)$|) {
				print "<FONT COLOR=#ff0000><B>Warning!</B> The current primary log filename is invalid!</FONT>\n";
			} elsif (!-e $g) {
				print "<FONT COLOR=#ff0000><B>Warning!</B> The currently specified primary log file does not exist!</FONT>\n";
			} elsif (!-r $g) {
				print "<FONT COLOR=#ff0000><B>Warning!</B> The currently specified primary log file is not readable!</FONT>\n";
			}
		}
		foreach $gl (keys(%GLOBAL_OPTIONS)) {
			if ($gl =~ m|^access_log|) {
				$GLOBAL_OPTIONS{$gl} = "" if $GLOBAL_OPTIONS{$gl} eq "0";
			}
		}
		print "<P>\n";
		print "<TABLE>\n";
		print "<TR><TD>$fs", "Primary Log File:</FONT></TD><TD><INPUT TYPE=TEXT NAME=access_log SIZE=40 VALUE='$GLOBAL_OPTIONS{'access_log'}'></TD></TR>\n";
		print "<TR><TD>$fs", "Old Log File #1:</FONT></TD><TD><INPUT TYPE=TEXT NAME=access_log_1 SIZE=40 VALUE='$GLOBAL_OPTIONS{'access_log_1'}'></TD></TR>\n";
		print "<TR><TD>$fs", "Old Log File #2:</FONT></TD><TD><INPUT TYPE=TEXT NAME=access_log_2 SIZE=40 VALUE='$GLOBAL_OPTIONS{'access_log_2'}'></TD></TR>\n";
		print "<TR><TD>$fs", "Old Log File #3:</FONT></TD><TD><INPUT TYPE=TEXT NAME=access_log_3 SIZE=40 VALUE='$GLOBAL_OPTIONS{'access_log_3'}'></TD></TR>\n";
		print "<TR><TD>$fs", "Old Log File #4:</FONT></TD><TD><INPUT TYPE=TEXT NAME=access_log_4 SIZE=40 VALUE='$GLOBAL_OPTIONS{'access_log_4'}'></TD></TR>\n";
		print "</TABLE>\n";
		print "</BLOCKQUOTE><P>\n";
		print "<B>Mailing List Generation</B>\n";
		print "<UL>\n";
		print "<LI><A HREF=\"$cgiurl?action=email_list&prm=1&username=$superuser\">Generate mailing list (users only)</A>\n";
		print "<LI><A HREF=\"$cgiurl?action=email_list&prm=2&username=$superuser\">Generate mailing list (moderators only)</A>\n";
		print "<LI><A HREF=\"$cgiurl?action=email_list&prm=3&username=$superuser\">Generate mailing list (user and moderators)</A>\n";
		print "</UL>\n";
		print "<P>\n";
	}
	print "<B>Message Size Limits</B>\n";
	print "<BLOCKQUOTE>\n";
	print "This section allows you to limit the length of messages posted by your visitors.\n";
	print "This option is presented mainly to protect against spammers.  Keep in mind that\n";
	print "1 kb = 1000 characters, or about 200 words.<P>\n";
	print "Message size limits: (a value of \"0\" indicates <I>no limit</I>)<P><BLOCKQUOTE>\n";
	print "</FONT><INPUT TYPE=TEXT NAME=public_msgsize SIZE=5";
	if ($GLOBAL_OPTIONS{'public_msgsize'}) {
		print " VALUE=\"$GLOBAL_OPTIONS{'public_msgsize'}\">\n";
	} else {
		print " VALUE=0>\n";
	}
	print "$fs kb for public posters<BR>\n";
	print "</FONT><INPUT TYPE=TEXT NAME=registered_msgsize SIZE=5";
	if ($GLOBAL_OPTIONS{'registered_msgsize'}) {
		print " VALUE=\"$GLOBAL_OPTIONS{'registered_msgsize'}\">\n";
	} else {
		print " VALUE=0>\n";
	}
	print "$fs kb for registered users<BR>\n";
	print "</FONT><INPUT TYPE=TEXT NAME=registered_mod_msgsize SIZE=5";
	if ($GLOBAL_OPTIONS{'registered_mod_msgsize'}) {
		print " VALUE=\"$GLOBAL_OPTIONS{'registered_mod_msgsize'}\">\n";
	} else {
		print " VALUE=0>\n";
	}
	print "$fs kb for moderators<P>\n";
	print "</BLOCKQUOTE></BLOCKQUOTE>\n";
	print "<B>New Messages Search Options</B>\n";
	print "<BLOCKQUOTE>\n";
	print "Configuration of first page<BR>\n";
	print "<UL><TABLE><TR><TD>$fs<U>Shown</U></TD><TD>$fs<U>Default</U></TD><TD>$fs<U>Option</U></TD></TR>\n";
	print "<TR><TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=nm_show_since VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'nm_show_since'} == 1 || $GLOBAL_OPTIONS{'nm_show_since'} eq "");
	print "></TD><TD ALIGN=CENTER><INPUT TYPE=RADIO NAME=nm_default VALUE=0 ";
	print " CHECKED" if $GLOBAL_OPTIONS{'nm_default'} == 0;
	print "></TD><TD>$fs", "Messages posted within last <I>x</I> days</TD></TR>\n";
	print "<TR><TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=nm_pw VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'nm_pw'} == 1 || $GLOBAL_OPTIONS{'nm_pw'} eq "");
	print "></TD><TD ALIGN=CENTER><INPUT TYPE=RADIO NAME=nm_default VALUE=1 ";
	print " CHECKED" if $GLOBAL_OPTIONS{'nm_default'} == 1;
	print "></TD><TD>$fs", "Messages searched by username/password</TD></TR>\n";
	print "<TR><TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=nm_after VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'nm_after'} == 1 || $GLOBAL_OPTIONS{'nm_after'} eq "");
	print "></TD><TD ALIGN=CENTER><INPUT TYPE=RADIO NAME=nm_default VALUE=2 ";
	print " CHECKED" if $GLOBAL_OPTIONS{'nm_default'} == 2;
	print "></TD><TD>$fs", "Messages posted after <I>date/time</I></TD></TR>\n";
	print "</TABLE></UL>\n";
	print "<INPUT TYPE=CHECKBOX NAME=nmshowdate VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'nmshowdate'} == 1 || $GLOBAL_OPTIONS{'nmshowdate'} eq "");
	print "> Show date and time of last post on search screen<BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=nmbold VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'nmbold'} == 1 || $GLOBAL_OPTIONS{'nmbold'} eq "");
	print "> Topic/subtopic names in <B>bold</B><BR>\n";
	print "<INPUT TYPE=CHECKBOX NAME=nmtreev VALUE=1";
	print " CHECKED" if ($GLOBAL_OPTIONS{'nmtreev'} == 1 || $GLOBAL_OPTIONS{'nmtreev'} eq "");
	print "> Tree view enabled by default<BR>\n";
	print "</BLOCKQUOTE>\n";
	print "<B>Order of Items</B>\n";
	print "<BLOCKQUOTE>\n";
	print "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>\n";
	print "<TR><TD COLSPAN=6 BGCOLOR=#ccccff>$fs<FONT SIZE=1>Add new subtopics to top</FONT></FONT></TD></TR>\n";
	print "<TR><TD BGCOLOR=#ccccff><FONT SIZE=1>&nbsp;</FONT></TD><TD BGCOLOR=#ccffcc COLSPAN=5>$fs<FONT SIZE=1>Alphabetize subtopics upon addition</FONT></FONT></TD></TR>\n";
	print "<TR><TD BGCOLOR=#ccccff><FONT SIZE=1>&nbsp;</FONT></TD><TD BGCOLOR=#ccffcc><FONT SIZE=1>&nbsp;</FONT></TD></TD><TD BGCOLOR=#ffcccc COLSPAN=4>$fs<FONT SIZE=1>Move active subtopic to top of list</FONT></FONT></TD></TR>\n";
	print "<TR><TD BGCOLOR=#ccccff><FONT SIZE=1>&nbsp;</FONT></TD><TD BGCOLOR=#ccffcc><FONT SIZE=1>&nbsp;</FONT></TD></TD><TD BGCOLOR=#ffcccc><FONT SIZE=1>&nbsp;</FONT></TD></TD><TD BGCOLOR=#ffff00 COLSPAN=3>$fs<FONT SIZE=1>Move active subtopic's parents to top of list</FONT></FONT></TD></TR>\n";
	print "<TR><TD BGCOLOR=#ccccff><FONT SIZE=1>&nbsp;</FONT></TD><TD BGCOLOR=#ccffcc><FONT SIZE=1>&nbsp;</FONT></TD></TD><TD BGCOLOR=#ffcccc><FONT SIZE=1>&nbsp;</FONT></TD><TD BGCOLOR=#ffff00><FONT SIZE=1>&nbsp;</FONT></TD></TD><TD BGCOLOR=#00aa00 COLSPAN=2>$fs<FONT SIZE=1>Add new messages to top</FONT></FONT></TD></TR>\n";
	open (FILE, "$message_dir/$board_topics_file");
	@lines = <FILE>;
	close(FILE);
	@rs = split(/,/, $GLOBAL_OPTIONS{'reverse_subs'});
	@rm = split(/,/, $GLOBAL_OPTIONS{'reverse_msgs'});
	@as = split(/,/, $GLOBAL_OPTIONS{'alphabet_subs'});
	@asp = split(/,/, $GLOBAL_OPTIONS{'active_subs_parents'});
	@active = split(/,/, $GLOBAL_OPTIONS{'active_subs'});
	$c = 0;
	foreach $line (@lines) {
		$_ = $line;
		if (/<!-Top: (\d+)-!>/) {
			$filename = "$message_dir/$1/$1.$ext"; $num = $1;
			&extract($filename);
			print "<TR><TD BGCOLOR=#ccccff>";
			print "<INPUT TYPE=CHECKBOX NAME=reverse_subs VALUE=$num";
			print " CHECKED" if grep(/^$num$/, @rs);
			print "></TD>\n";
			print "<TD ALIGN=CENTER BGCOLOR=#ccffcc><INPUT TYPE=CHECKBOX NAME=alphabet_subs VALUE=$num";
			print " CHECKED" if grep(/^$num$/, @as);
			print "></TD>\n";
			print "<TD ALIGN=CENTER BGCOLOR=#ffcccc><INPUT TYPE=CHECKBOX NAME=active_subs VALUE=$num";
			print " CHECKED" if grep(/^$num$/, @active);
			print " onClick=\"if (document.forms[0].active_subs[$c].checked == false) { document.forms[0].active_subs_parents[$c].checked = false; }\"></TD>\n";
			print "<TD ALIGN=CENTER BGCOLOR=#ffff00><INPUT TYPE=CHECKBOX NAME=active_subs_parents VALUE=$num";
			print " CHECKED" if grep(/^$num$/, @asp);
			print " onClick=\"if (document.forms[0].active_subs_parents[$c].checked == true) { document.forms[0].active_subs[$c].checked = true; }\"></TD>\n";
			print "<TD ALIGN=CENTER BGCOLOR=#00aa00><INPUT TYPE=CHECKBOX NAME=reverse_msgs VALUE=$num";
			print " CHECKED" if grep(/^$num$/, @rm);
			print "></TD>\n";
			print "<TD>$fs&nbsp;$topic_name</FONT></TD></TR>\n";
			$c += 1;
		}
	}
	print "</TABLE>\n";
	print "</BLOCKQUOTE>\n";
	if ($pro) {
		print "<B>Profiles</B>\n";
		print "<BLOCKQUOTE>\n";
		print "The following option allows you to configure the fields that are presented to users for their profile information.<P>\n";
		print "<UL><LI><A HREF=\"$cgiurl?action=profile_fields&username=$superuser\">Define profile fields</A>\n";
		print "</UL></BLOCKQUOTE>\n";
	}
	print "<B>Time Zone</B>\n";
	print "<BLOCKQUOTE>\n";
	print "Number of hours to add to or subtract from the time reported by the server.\n";
	print "The current server time is ";
	($dt) = &get_date_time("long", 0, 591);
	print "$dt.  To add 3 hours to this time, you would enter &quot;3&quot; in the\n";
	print "blank; to subtract 2 hours from this time, you would enter &quot;-2&quot;\n";
	print "in the blank.<P>\n";
	print "Hours to add/subtract from time:</FONT>  <INPUT TYPE=TEXT NAME=timezone SIZE=5";
	if ($GLOBAL_OPTIONS{'timezone'}) {
		print " VALUE=\"$GLOBAL_OPTIONS{'timezone'}\">\n";
	} else {
		print " VALUE=0>\n";
	}
	print "$fs<P>\n";
	print "<INPUT TYPE=CHECKBOX NAME=usegmtime VALUE=1";
	print " CHECKED" if $GLOBAL_OPTIONS{'usegmtime'} == 1;
	print "> Use GMT time in computations rather than local time\n";
	print "</BLOCKQUOTE>\n";
	print "<INPUT TYPE=SUBMIT VALUE=\"Save Options\">\n";
	print "</TD></TR></TABLE>\n";
	print "</FORM></BODY></HTML>\n";
	exit(0);
}

#---SEPARATOR---#

sub version_manager {
	&header;
	print "<HTML><HEAD><TITLE>Version Manager</TITLE></HEAD>\n";
	print "<BODY BGCOLOR=ffffff TEXT=000000 LINK=0000ff VLINK=0000ff>\n";
	print "$fs<FONT SIZE=3><CENTER><B>Version Manager</B></CENTER></FONT><HR>\n";
	print "<H3>Information</H3>\n";
	print "<TABLE BORDER=1 WIDTH=100% BGCOLOR=ffffcc><TR><TD>$fs\n";
	print "&quot;$title&quot; is running Discus <B>";
	print $release_version;
	print ".";
	$revision_number = $free_revision if !$pro;
	$revision_number = $pro_revision if $pro;
	print $revision_number;
	print " PRO" if $pro;
	print "</B>.<BR>\n";
	print "Discus Pro License Number: <B>$pro_license</B><BR>\n" if $pro;
	$count = 0;
	opendir(DIR, "$admin_dir/msg_index");
	while ($dir = readdir(DIR)) {
		next if $dir !~ m|^(\d+)-log\.txt$|;
		open (FILE, "$admin_dir/msg_index/$dir");
		while (<FILE>) {
			$count += 1;
		}
		close (FILE);
	}
	closedir(DIR);
	print "There ";
	print "is" if $count == 1;
	print "are" if $count != 1;
	print " currently <B>$count</B> message";
	print "s" if $count != 1;
	print " on your board.<P>\n";
	if ($contact =~ m|([\w\.\-\+]+)\@([\w\.\-\+]+)|) {
		$cemail = escape(join("\@", $1, $2));
	} else {
		$cemail = "";
	}
	if ($script_url =~ m|^https://|i) {
		print "Sorry, but we can't display the current version of Discus to you because your board is running\n";
		print "under SSL.  You can find out the current version of Discus by clicking this link: \n";
		$time = time;
		print "<A HREF=\"#\" onClick=\"javascript:window.open('http://www.discusware.com/cgi-bin/discus/version.cgi?url=$html_url&unique=$time&my_version=$release_version.$revision_number&pro=$pro&pro_license=$pro_license&cemail=$cemail&count=$count', '', 'height=40,width=200');\">Version Info</A>\n";
	} else {
		print "The current version of Discus is: <IMG SRC=\"http://www.discusware.com/cgi-bin/discus/version.cgi?url=$html_url&unique=" . time . "&my_version=$release_version.$revision_number&pro=$pro&pro_license=$pro_license&cemail=$cemail&count=$count\" HEIGHT=50 WIDTH=150 ALIGN=TOP>\n";
	}
	print "</TD></TR></TABLE>\n";
	print "<P><HR><P>\n";
	print "<H3>Download the Latest Version</H3>\n";
	print "<TABLE BORDER=1 WIDTH=100% BGCOLOR=ffffcc><TR><TD>$fs\n";
	print "<b>Telnet/Console Distribution Download</b><p>If you wish to upgrade by telnet or console, you need to download the latest\n";
	print "distribution from the Discus site.  Visit our <A HREF=\"http://www.discusware.com/discus/download.html\" TARGET=_blank>" if !$pro;
	print "distribution from the Discus site.  Visit our <A HREF=\"http://www.discusware.com/pro/download.html\" TARGET=_blank>" if $pro;
	print "<B>download page</B></A> to get the latest version.<P><HR NOSHADE>\n";
	print "<b>FTP Distribution Download</b><p>\n";
	print "If you wish to upgrade this board by FTP, you can instantly prepare a distribution by clicking on the following\n";
	print "button.\n";
	print "<FORM NAME=uf TARGET=_blank METHOD=POST ACTION=\"http://www.discusware.com/cgi-bin/discus/ftp/ftp-inst.cgi\">\n";
	open (A, "$script_dir/board-admin.$cgi_extension");
	@a = <A>;
	close (A);
	$p = $a[0];
	$p =~ s/^#!//;
	$p =~ s/\s+$//;
	print "<INPUT TYPE=HIDDEN NAME=pathperl VALUE=\"$p\">\n";
	print "<INPUT TYPE=HIDDEN NAME=discusconf VALUE=\"";
	open (D, "$admin_dir/discus.conf"); @d = <D>; close (D);
	$d = join("", @d);
	print &escape($d);
	print "\">\n";
	print "<INPUT TYPE=HIDDEN NAME=escaped VALUE=1>\n";
	print "<INPUT TYPE=HIDDEN NAME=action VALUE=upgrade>\n";
	print "<INPUT TYPE=HIDDEN NAME=version_requested VALUE=latest>\n";
	if ($script_url =~ m|^https://|i) {
		print "<ul><INPUT TYPE=RADIO NAME=beta VALUE=0 CHECKED>Latest official release<BR>\n";
	} else {
		print "<ul><INPUT TYPE=RADIO NAME=beta VALUE=0 CHECKED>Version shown above<BR>\n";
	}
	print "<INPUT TYPE=RADIO NAME=beta VALUE=1>Beta version (if available)</ul>\n";
	if (! $pro) {
		print "If you have just purchased <a href=http://www.discusware.com/pro TARGET=_blank>Discus Pro</a>,\n";
		print "supply your license number in the following box to upgrade.\n";
		print "<ul>\n";
		print "Pro License Number: </font>\n";
		print "<input type=text name=pro_license value='' size=20>$fs</ul>\n";
	} else {
		print "<INPUT TYPE=HIDDEN NAME=pro_fileid VALUE='$pro_fileid'>\n";
		print "<INPUT TYPE=HIDDEN NAME=pro_license VALUE='$pro_license'>\n";
		print "<INPUT TYPE=HIDDEN NAME=get_pro VALUE=1>\n";
	}
	print "<P><INPUT TYPE=SUBMIT VALUE=\"Download FTP Distribution\">";
	print "</FORM>\n";
	print "</TD></TR></TABLE>\n";
	print "<P><HR><P>\n";
	print "<H3>Discus Mailing List</H3>\n";
	print "<TABLE BORDER=1 WIDTH=100% BGCOLOR=ffffcc><TR><TD>$fs\n";
	print "To keep up to date with Discus releases, join the Discus mailing list!  You will receive announcements of Discus\n";
	print "product upgrades and other important information.  Your e-mail address will not be distributed or sold.\n";
	print "<FORM NAME=ml METHOD=POST ACTION=\"http://www.discusware.com/cgi-bin/discus/list.cgi\">\n";
	print "</FONT><INPUT TYPE=TEXT NAME=email SIZE=50 VALUE=\"";
	if ($contact =~ m|<A HREF="mailto:(.*)">(.*)</A>|) {
		print "$1";
	}
	print "\">\n";
	print "<INPUT TYPE=HIDDEN NAME=url VALUE=\"$html_url\">\n";
	print "<INPUT TYPE=HIDDEN NAME=cgiurlm VALUE=\"$cgiurlm\">\n";
	print "<INPUT TYPE=HIDDEN NAME=username VALUE=\"$FORM{'username'}\">\n";
	print "<P><INPUT TYPE=SUBMIT VALUE=\"Join List!\">\n";
	print "</TD></TR></TABLE>\n";
	if (!$pro) {
		print "<P><HR><H3>Buy Discus Pro</H3>\n";
		print "<TABLE BORDER=1 WIDTH=100% BGCOLOR=ffffcc><TR><TD>$fs\n";
		print "Discus Pro is a set of add-on features with such functionality as:<P><UL>\n";
		print "<LI>Password-protected reading of topics\n";
		print "<LI>User self-registration\n";
		print "<LI>Automatic archiving and pruning of the board\n";
		print "<LI>Message queue (moderators approve posts)\n";
		print "<LI>Enhanced user profiles & e-mail notification\n";
		print "<LI>Backup and restore board files\n";
		print "<LI>Attachment uploading (any file types)\n";
		print "<LI>IP screening (banning or automatic privileges)\n";
		print "<LI>Log analysis tools\n";
		print "<LI><I>and many more...</I>\n</UL>\n";
		print "You will get to keep all messages, users, moderators, and settings\n";
		print "when you upgrade.  For more information, please browse to:<P>\n";
		print "<UL><B><A HREF=\"http://www.discusware.com/pro\" TARGET=_blank>";
		print "http://www.discusware.com/pro</A></B></UL><P>\n";
		print "<FONT SIZE=1>The above statements are true as of the release date\n";
		print "of this version of Discus.  Features, availability, and prices are\n";
		print "subject to change.  For more information, follow the above link.\n";
		print "</FONT></FONT>\n";
		print "</TD></TR></TABLE><P>\n";
	}
	print "<P><HR><P>\n";
	print "<H3>Discus File Update Procedure</H3>\n";
	print "<TABLE BORDER=1 WIDTH=100% BGCOLOR=ffffcc><TR><TD>$fs\n";
	print "When you <B>first</B> installed version 3.10, if you were upgrading from a previous\n";
	print "version, you were prompted to update the Discus files.  The link here is provided if\n";
	print "you missed that upgrade or for some reason need to repeat it.<P>\n";
	print "<FONT COLOR=#ff0000><B>Performing an upgrade on an already working 3.10 board is\n";
	print "not recommended unless directed by DiscusWare.  This procedure generally needs to be performed\n";
	print "only when the program prompts you to do so, which is <U>not</U> now.</B></FONT>\n";
	print "<P><A HREF=$cgiurlm?action=version&username=$superuser>Click here</A> to access the file update tool.\n";
	print "</TD></TR></TABLE>\n";
	print "</BODY></HTML>\n";
	exit(0);
}

#---SEPARATOR---#
#REQ:get_number
#REQ:regenerate_board

sub options_save {
	@otherwise_defined = ('skinchoice', 'COLOR_bgcolor', 'COLOR_text', 'COLOR_link', 'COLOR_vlink', 'COLOR_alink', 'COLOR_image', 'COLOR_face', 'COLOR_size');
	$icons_on = 0; $old_anon = $GLOBAL_OPTIONS{'anonymous'};
	if ($GLOBAL_OPTIONS{'message_icons'}) {
		$icons_on = 1;
		$mi{'message_icon_top'} = $GLOBAL_OPTIONS{'message_icon_top'};
		$mi{'message_icon_up'} = $GLOBAL_OPTIONS{'message_icon_up'};
		$mi{'message_icon_down'} = $GLOBAL_OPTIONS{'message_icon_down'};
		$mi{'message_icon_bottom'} = $GLOBAL_OPTIONS{'message_icon_bottom'};
		$mi{'message_icon_link'} = $GLOBAL_OPTIONS{'message_icon_link'};
	} else {
		$FORM{'message_icon_top'} = $GLOBAL_OPTIONS{'message_icon_top'};
		$FORM{'message_icon_up'} = $GLOBAL_OPTIONS{'message_icon_up'};
		$FORM{'message_icon_down'} = $GLOBAL_OPTIONS{'message_icon_down'};
		$FORM{'message_icon_bottom'} = $GLOBAL_OPTIONS{'message_icon_bottom'};
		$FORM{'message_icon_link'} = $GLOBAL_OPTIONS{'message_icon_link'};
	}
	foreach $key (keys(%FORM)) {
		next if ($key eq "action" || $key eq "username");
		next if $key =~ /\W/;
		$val = $FORM{$key};
		$val =~ s/[^\d\-\,\.]//g if ($key ne "alternate_topic_navbar_url" && $key ne "spellchecker_custid" && $key ne "otherdict" && $key ne "spellchecker_language" && $key ne "charset" && $key !~ m|^ip_banned| && $key !~ m|^access_log| && $key !~ m|^message_icon_| && $key !~ m|^alt_color_| && $key !~ m|^admin_contact|);
		$val = 0 if ($val eq "" && $key ne "alternate_topic_navbar_url");
		$GLOBAL_OPTIONS{$key} = $val;
	}
	if ($FORM{'spellchecker_language'} eq "zzother") {
		$GLOBAL_OPTIONS{'spellchecker_language'} = "*$FORM{'otherdict'}";
	}
	delete $FORM{'otherdict'};
	foreach $thing (@otherwise_defined) {
		$FORM{$thing} = $GLOBAL_OPTIONS{$thing};
	}
	foreach $key (keys(%GLOBAL_OPTIONS)) {
		if (!$FORM{$key}) {
			$GLOBAL_OPTIONS{$key} = 0 if ($key !~ m|^ip_banned| && $key !~ m|^message_icon_| && $key ne "alternate_topic_navbar_url");
		}
	}
	if ($FORM{'ip_banned_list'} eq "") {
		$GLOBAL_OPTIONS{'ip_banned_list'} = "";
		foreach $key (keys(%GLOBAL_OPTIONS)) {
			$GLOBAL_OPTIONS{$key} = "" if $key =~ m|^ip_banned_(\d+)|;
		}
	}
	if ($GLOBAL_OPTIONS{'ip_banned_list'}) {
		@validip = split(/,/, $GLOBAL_OPTIONS{'ip_banned_list'});
		foreach $key (keys(%GLOBAL_OPTIONS)) {
			if ($key =~ m|^ip_banned_(\d+)|) {
				$m = $1;
				$GLOBAL_OPTIONS{$key} = "" if !grep(/^$m$/, @validip);
			}
		}
	}
	if ($FORM{'ip_banned_new'} && $FORM{'ip_banned_NEW'}) {
		$GLOBAL_OPTIONS{'ip_banned_list'} .= "," if $GLOBAL_OPTIONS{'ip_banned_list'} ne "";
		($num) = &get_number;
		$GLOBAL_OPTIONS{'ip_banned_list'} .= $num;
		$GLOBAL_OPTIONS{"ip_banned_$num"} = $FORM{'ip_banned_NEW'};
	}
	$GLOBAL_OPTIONS{'ip_banned_new'} = ""; $GLOBAL_OPTIONS{'ip_banned_NEW'} = "";
	&lock("options_save", "$admin_dir/options.txt");
	open (OPTIONS, ">$admin_dir/options.txt") || &error_message("Save Options Error", "Could not write to file $admin_dir/options.txt");
	foreach $key (sort(keys(%GLOBAL_OPTIONS))) {
		print OPTIONS "$key=$GLOBAL_OPTIONS{$key}\n" if $GLOBAL_OPTIONS{$key} ne "";
	}
	close (OPTIONS);
	&unlock("options_save", "$admin_dir/options.txt");
	if (($GLOBAL_OPTIONS{'anonymous'} + $old_anon) % 2 == 1) {
		if (open (TOP, "$message_dir/$board_topics_file")) {
			@top = <TOP>;
			close (TOP);
			if (grep(/^<!-Top: (\d+)-!>/, @top)) {
				&regenerate_board('Regenerating &quot;Add a Message&quot; boxes', "$cgiurl2?username=$superuser&action=templates&rrrrr=4", "$cgiurlm?username=$superuser&cmd=options_mgr", "", 5, "");
			}
		}
	}
}

# END - FILE IS CORRECTLY UPLOADED #
