# FILE: src-board-subs-20
# Dynamic User Interface
#-------------------------------------------------------------------------------
# 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---#

sub printuntil {
	my ($start, $finish, $topic_number, $title_in, $flag, $cache, $spellchecker, $checkform) = @_;
	$cs = $GLOBAL_OPTIONS{'charset'};
	$cs = $GLOBAL_OPTIONS{'charset_disp'} if $GLOBAL_OPTIONS{'charset_disp'};
	if (!$cache) {
		($template, $addfile) = &determine_templates($topic_number, 1, 1, 0);
		@PrintUntil_FILE = split(/\n/, $template);
		if ($flag != 1) {
			($bgcolor, $text, $link, $vlink, $alink, $face, $size, $image) = &extract_colorsonly;
		}
		foreach $line (@PrintUntil_FILE) {
			$line .= "\n";
			$line =~ s/\$title/$title_in/g if $title_in;
			$line = &eval_subst($line);
			if ($line =~ m|</HEAD>|i && $cs ne "" && $cs ne "0") {
				$line = "<!-ShowMeta-!><META http-equiv=\"Content-Type\" content=\"text/html; charset=$cs\">\n$`</HEAD>$'\n";
			}
		}
	}
	$cpos = 0;
	foreach $line (@PrintUntil_FILE) {
		if ($line =~ m|</HEAD>|i && $spellchecker && $cpos && $spellchecker_net_feature_on) {
			if (($ENV{'HTTP_USER_AGENT'} =~ m|MSIE (\d+)| && $1 >= 4) || ($ENV{'HTTP_USER_AGENT'} =~ m|Mozilla/(\d+)| && $1 >= 4 && $ENV{'HTTP_USER_AGENT'} !~ m|MSIE|)) {
				my ($customer_id, $lang, @file, $line2);
				if ($GLOBAL_OPTIONS{'spellcheck_custid'} ne "0" && $GLOBAL_OPTIONS{'spellcheck_custid'} ne "") {
					$customer_id = $GLOBAL_OPTIONS{'spellcheck_custid'};
				} else {
					# DiscusWare's customer ID; will allow this to work properly
					# DO NOT CHANGE
					$customer_id = "0210226189";
				}
				print "<script language=\"JavaScript\">\n";
				print "<!--\n";
				if (open(FILE, "$admin_dir/source/src-board-subs-spch")) {
					@file = <FILE>;
					close (FILE);
					foreach $line2 (@file) {
						$line2 =~ s/<#CUSTOMERID#>/$customer_id/g;
					}
					print @file;
				} else {
					$spellchecker_net_feature_on = 0;
				}
				print "// -->\n";
				print "</SCRIPT>\n";
				print $line;
				next;
			}
		}
		if ($checkform && $line =~ m|<BODY([^>]+)>|) {
			my ($bf, $af, $mt, $mm);
			$bf = $`; $af = $'; $mt = $1;
			if ($mt =~ m|onLoad="([^"]+)"|) {
				$line = join("", $bf, "<BODY", $`, "onLoad=\"document.MF.pgloaded.value = 1; $1\"", $', ">", $af);
				$FORMINFO_LOAD = 1;
			}
		}
		if ($line =~ m|<!--Start-->|) {
			$cpos = 1;
		} elsif ($line =~ m|<!--Bigtitle-->|) {
			$cpos = 2;
		} elsif ($line =~ m|<!--/Bigtitle-->|) {
			$cpos = 3;
		} elsif ($line =~ m|<!--Navbar-->|) {
			$cpos = 4;
		} elsif ($line =~ m|<!--/Navbar-->|) {
			$cpos = 5;
		} elsif ($line =~ m|<!--Announcement-->|) {
			$cpos = 0;
		} elsif ($line =~ m|<!--/Announcement-->|) {
			$cpos = 5;
		} elsif ($line =~ m|<!--Sublist-->|) {
			$cpos = 6;
		} elsif ($line =~ m|<!--/Sublist-->|) {
			$cpos = 7;
		} elsif ($line =~ m|<!--Create-->|) {
			$cpos = 8;
		} elsif ($line =~ m|<!--/Create-->|) {
			$cpos = 9;
		} elsif ($line =~ m|<!--About-->|) {
			$cpos = 10;
		} elsif ($line =~ m|<!--/About-->|) {
			$cpos = 11;
		} elsif ($line =~ m|<!--Messages-->|) {
			$cpos = 12;
		} elsif ($line =~ m|<!--/Messages-->|) {
			$cpos = 13;
		} elsif ($line =~ m|<!--Add-->|) {
			$cpos = 14;
		} elsif ($line =~ m|<!--/Add-->|) {
			$cpos = 15;
		} elsif ($line =~ m|<!--Message Source|) {
			$cpos = 16;
		} elsif ($line =~ m|-->| && $cpos == 16) {
			$cpos = 17;
		} elsif ($line =~ m|<META|i && $line !~ m|<!-ShowMeta-!>|) {
			# Skip
		} elsif ($line =~ m|<!-AdminFromHere-!>|) {
			# Skip
		} elsif ($start == $finish && $cpos == $start) {
			print $line if $line =~ /\S/;
		} elsif ($start != $finish && $cpos >= $start && $cpos <= $finish && $cpos % 2 == 1) {
			print $line if $line =~ /\S/;
		}
	}
}

#---SEPARATOR---#
#REQ:mail_administrator_quota





# END - FILE IS CORRECTLY UPLOADED #
