<MIVA standardoutputlevel=""></MIVA>
<MvASSIGN NAME="OFF" VALUE = "{'<MIVA standardoutputlevel=\"\">'}">
<MvASSIGN NAME="ON" VALUE = "{'<MIVA standardoutputlevel=\"text,html\">'}">
<MvCOMMENT>###################################################################
# Message Board Version 1.1 #
# Developed by Michael Sussna Yahoo! #
# Created 12/11/97 Last Modified 9/28/99 #
# Based on WWWBoard #
# Copyright 1996 Matt Wright mattw@worldwidemart.com #
# Scripts Archive at: http://www.worldwidemart.com/scripts/ #
##############################################################################
# WWWBoard COPYRIGHT NOTICE #
# Copyright 1996 Matthew M. Wright All Rights Reserved. #
# #
# WWWBoard may be used and modified free of charge by anyone so long as #
# this copyright notice and the comments above remain intact. By using this #
# code you agree to indemnify Matthew M. Wright from any liability that #
# might arise from it's use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact.#
##############################################################################
# Yahoo!, Inc. COPYRIGHT NOTICE #
# Copyright 1998-1999 Simple Network Communications, Inc. #
# Copyright 1999-2000 Yahoo!, Inc. #
# All rights reserved. #
##############################################################################
# #
# CHANGE LOG #
# #
# Version 1.16, 8/01/01: #
# #
# Added additional checks for executable code being submitted in form #
# fields. #
# #
# Version 1.15, 8/16/00: #
# #
# Added additional checks for executable code being submitted in form #
# fields. #
# #
# Version 1.14, 6/7/00: #
# #
# Added additional file locking logic to Remove and Compress Database #
# functions. #
# #
# Version 1.13, 9/28/99: #
# #
# Added MvLOCKFILE to Compress Database function. This should prevent #
# potential conflicting write accesses to the database during a compress. #
# #
# Version 1.12, 2/11/99: #
# #
# Changed default year in search to be current year. #
# #
# Version 1.11, 12/24/98: #
# #
# Added URL information in post and followup preview. #
# #
# Version 1.10, 12/18/98: #
# #
# Added "In reply to" feature when viewing a message. #
# Changed access of messages to use MvFIND, significantly speeding access. #
# Added wildcard to IP blocking in Admin. #
# #
##################################################################</MvCOMMENT>
<MvCOMMENT> Define Variables </MvCOMMENT>
<MvASSIGN NAME = "mesgdir" VALUE = "{'messages'}">
<MvASSIGN NAME = "passwd_file" VALUE = "{'passwd.txt'}">
<MvASSIGN NAME = "config_file" VALUE = "{'config.txt'}">
<MvASSIGN NAME = "unwelcome_list" VALUE = "{'unwelcome.txt'}">
<MvASSIGN NAME = "unwelcome_list2" VALUE = "{'unwelcome2.txt'}">
<MvASSIGN NAME = "ext" VALUE = "{'txt'}">
<MvCOMMENT> This is a special self number in the database: </MvCOMMENT>
<MvASSIGN NAME = "super_root" VALUE = "{'9999999'}">
<MvCOMMENT>
The message board is displayed in a specific sequence. The most recent
main postings (or roots) are displayed first. Within each main posting
any followup postings are then displayed, most recent first. Followups
to followups are displayed most recent first, and so on. This produces
a hierarchy of postings.
To build this display as fast as possible from the database, each posting
is assigned a sequence number. The sequence numbers are designed so that
the hierarchy follows from simply listing the postings in sequence. For
example, suppose that there are 10 postings that should display in the
following hierarchy:
4
10
5
8
9
6
7
3
1
2
The main postings are 1, 3, and 4. 4 is the most recent main posting.
Posting 4 has 2 followups, 5 and 10. 10 is more recent than 5 and has
no followups. 5 has two followups, 6 and 8, each of which has a followup.
The numbering of the postings reflects the order in which they were
created, 10 being the most recently created posting.
To simply list the postings so that they would display in the proper
order above, we would need the following relationships between any
sequence numbers assigned: 4's sequence number should be first in the
list, followed by 10's, 5's, 8's, 9's, 6's, 7's, 3's, 1's, and finally
2's.
We could assign ascending sequence numbers, but we actually assign
descending numbers. So, in our example, we could think of the sequence
number assignments as 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 for postings
4, 10, 5, 8, 9, 6, 7, 3, 1, and 2 respectively.
There are several constraints which influence our scheme for sequence
numbering:
Each posting should have a unique sequence number --- we want to avoid
duplicates so that there is no ambiguity when listing postings.
Each sequence number should correctly reflect the relative position of its
posting in the hierarchy --- thus it should fall between the sequence
numbers of the postings between which the new posting is being inserted.
Insertion can occur at any arbitrary point in the hierarchy. We cannot
know ahead of time how many postings will be placed at any given location.
Finally, we need to allow for a reasonably large number of levels of
followup. In actual practice it is not unusual to see 20 levels of
followup. That is, one main posting could have a followup which could
have a followup which could have a followup, and so on, to 20 levels of
followup.
To accommodate these constraints, we have devised the following scheme
for sequence numbering. Unique numbering is supported by careful planning
for handling the other constraints. Reflecting relative position in the
hierarchy is provided by selecting a sequence number for a new posting
that lies between the sequence numbers of the postings before and after
the new posting.
By assigning each root a comfortable range of numbers for its followups,
we lay the foundation for satisfying the final two constraints. Suppose
that we allow 1000 followups per root. So the roots are numbered 1000,
2000, and so on as they are created. Followups are numbered sequentially
from 1 within that range. So root 2000's followups fall in the range
1001 - 1999, since posting 2000 must display before any of its followups.
The first followup gets 1001. If a second followup to posting 2000 is
created, it gets sequence number 1002. But what if a followup to posting
1001 is created? It needs a sequence number lower than 1001, since it
must display after 1001, right? What if we renumber so that what was 1001
becomes 1002, and the new posting gets 1001? This is the scheme that we use.
As a followup is inserted, it causes a renumbering of all followups between
it and the root. So suppose we have 1001 - 1005, and need to insert a new
followup to 1003? 1001 and 1002 can stay unchanged. 1003 - 1005 need to
be incremented, and the new posting becomes 1003. The root stays at 2000.
This scheme satisfies both of the final constraints because arbitrary
insertion is accommodated and because any number of levels of followup is
allowed as well. At least, any number of followups that fit within the
range of 1000 numbers. Nested followups share the range of numbers with
any other followups.
But how does this method affect performance? Since the renumbering is
localized to just the region of numbers assigned to a single root, this
minimizes the impact. Since just the followups between the new posting and
the root must be visited, this reduces the impact further.
All ancestors of a new posting must be visited, to update their count of
descendents. We do this by moving back from the parent to the root. All
of the postings between the root and the new posting must have their
sequence numbers incremented. We do this by moving forward from the root
to the parent.
Unfortunately these two movements oppose each other. But, each requires
its specific direction of motion. The chain of ancestors flows bottom up
in the hierarchy, that is, from leaf to root. We learn the parent of a
posting from the posting's database record. This means traveling from
parent to grandparent etc. as we move back to the root via index1
(sequence number). Not all of the postings encountered are necessarily
in the lineage of the new posting.
For updating the sequence numbers, we move forward from the root because
otherwise we would be assigning duplicate numbers temporarily, which is
enough time to do damage. For example, say we have root 2000 and followups
1002 and 1001 under it. We want to insert a followup to 1001. Note
that it doesn't matter whether 1001 and 1002 are both followups to 2000,
or 1001 is a followup to 1002. We want the end result of the insertion
to be the sequence 2000, 1003, 1002, 1001 with the new posting being 1001.
If we start the renumbering with the old 1001 and move back towards the
root, when we make 1001 into 1002 we now temporarily have two 1002's.
This throws off the index and plays havoc. Skipping back from this finds
2000, not the original 1002. So, we must start from the root and move
forward, making 1002 into 1003, then 1001 into 1002. Then we can safely
create a new sequence number of 1001 for the new posting.
One final note on performance considerations is the following. The current
maximum sequence number is stored in the super root as its sequence number.
This means that we have to retrieve that sequence number before inserting
a main posting, and update that number with the new value. But we have to
access the super root's database record anyway when we create a posting,
because we need to update its number of descendents, which generates the
message number for the new posting.
By using a 10-digit number for sequencing, and allowing 1000 followups per
main posting, we are allowing for 10,000,000 main postings. We can change
these values, but doing so means that existing postings would be obsolete.
</MvCOMMENT>
<MvASSIGN NAME = "max_seqnum_increment" VALUE = "{'0000001000'}">
<MvASSIGN NAME = "seqnum_size" VALUE = "{'10'}">
<MvCOMMENT> Increment for creating self and parent numbers: </MvCOMMENT>
<MvASSIGN NAME = "big_bump" VALUE = "{'1000000'}">
<MvASSIGN NAME = "db_just_created" VALUE = "{'0'}">
<MvASSIGN NAME = "textwidth" VALUE = "{'60'}">
<MvASSIGN NAME = "urlwidth" VALUE = "{'80'}">
<MvASSIGN NAME = "admin_banner_ad" VALUE = "{''
}">
<MvASSIGN NAME = "banner_ad" VALUE = "{''
}">
<MvASSIGN NAME = "newline" VALUE = "{asciichar(10)}">
<MvASSIGN NAME = "carriage" VALUE = "{asciichar(13)}">
<MvASSIGN NAME = "crlf" VALUE = "{carriage $ newline}">
<MvASSIGN NAME = "amp" VALUE = "{asciichar(38)}">
<MvASSIGN NAME = "quote" VALUE = "{asciichar(39)}">
<MvASSIGN NAME = "longquote" VALUE = "{'''}">
<MvASSIGN NAME = "period" VALUE = "{asciichar(46)}">
<MvASSIGN NAME = "slash" VALUE = "{asciichar(47)}">
<MvASSIGN NAME = "less" VALUE = "{asciichar(60)}">
<MvASSIGN NAME = "greater" VALUE = "{asciichar(62)}">
<MvASSIGN NAME = "qmark" VALUE = "{asciichar(63)}">
<MvASSIGN NAME = "atsign" VALUE = "{asciichar(64)}">
<MvASSIGN NAME = "backslash" VALUE = "{asciichar(92)}">
<MvASSIGN NAME = "newlines" VALUE = "{crlf $ crlf}">
<MvASSIGN NAME = "longless" VALUE = "{'<'}">
<MvASSIGN NAME = "longgreater" VALUE = "{'>'}">
<MvASSIGN NAME = "dquote" VALUE = "{'\"'}">
<MvASSIGN NAME = "longdquote" VALUE = "{'"'}">
<MvASSIGN NAME = "bullet" VALUE = "{asciichar(149)}">
<MvASSIGN NAME = "nbsp" VALUE = "{asciichar(174)}">
<MvASSIGN NAME = "longnbsp" VALUE = "{' '}">
<MvASSIGN NAME = "indent" VALUE = "{' '}">
<MvASSIGN NAME = "delim" VALUE = "{'!!##!!'}">
<MvASSIGN NAME = "yuml" VALUE = "{asciichar(255)}">
<MvCOMMENT>###########################################################</MvCOMMENT>
<MvCOMMENT>###########################################################</MvCOMMENT>
<MvCOMMENT> MAIN PROCESSING </MvCOMMENT>
<MvEVAL EXPR = Initialization()>
<MvIF EXPR = "{parm_func EQ 'showmain' OR parm_func EQ ''}">
<MvEVAL EXPR = ShowMain()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'showmsg'}">
<MvEVAL EXPR = ShowMessage()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'showpostform'}">
<MvEVAL EXPR = ShowPostForm()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'showsearch'}">
<MvEVAL EXPR = ShowSearchForm()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'post'}">
<MvEVAL EXPR = PostControl()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'postpreview'}">
<MvEVAL EXPR = ShowPostPreview()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'followuppreview'}">
<MvEVAL EXPR = ShowFollowupPreview()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'showfaq'}">
<MvEVAL EXPR = ShowFAQ()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_func EQ 'admin'}">
<MvEVAL EXPR = Admin()>
<MvEXIT>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvEXIT>
<MvCOMMENT> END OF MAIN PROCESSING </MvCOMMENT>
<MvFUNCTION NAME = "Initialization">
<MvIF EXPR = "{nargs GT 1 AND arg2 EQ 'admin'}">
<MvASSIGN NAME = "parm_func" VALUE="{'admin'}">
<MvELSE>
<MvEVAL EXPR = GetFormInput()>
</MvIF>
<MvEVAL EXPR = FindMboardName()>
<MvIF EXPR = "{NOT fexists(dirprefix)}">
<MvASSIGN NAME = "x" VALUE = "{fmkdir(dirprefix)}">
</MvIF>
<MvASSIGN NAME = "msgfiledir" VALUE = "{dirprefix $ '/' $ mesgdir}">
<MvIF EXPR = "{NOT fexists(msgfiledir)}">
<MvASSIGN NAME = "x" VALUE = "{fmkdir(msgfiledir)}">
</MvIF>
<MvIF EXPR = "{NOT fexists(database)}">
<MvEVAL EXPR = CreateDatabase()>
</MvIF>
<MvASSIGN NAME = "passwdfile" VALUE = "{dirprefix $ '/' $ passwd_file}">
<MvIF EXPR = "{NOT fexists(passwdfile)}">
<MvIF EXPR = "{action EQ 'provide_identity'}"> <MvCOMMENT> Done til input errors fixed </MvCOMMENT>
<MvEVAL EXPR = ProvideIdentity("ShowProvideIdentity")>
<MvELSE>
<MvIF EXPR = "{parm_func EQ ''}"> <MvCOMMENT> 1st time in </MvCOMMENT>
<MvEVAL EXPR = ShowWelcome()>
<MvELSE>
<MvEVAL EXPR = ShowProvideIdentity()>
</MvIF>
</MvIF>
</MvIF>
<MvASSIGN NAME = "configfile" VALUE = "{dirprefix $ '/' $ config_file}">
<MvIF EXPR = "{NOT fexists(configfile)}">
<MvEVAL EXPR = SetupLinks()> <MvCOMMENT> No title yet, but don't care. </MvCOMMENT>
<MvEVAL EXPR = AssignDefaultSettings()>
<MvEVAL EXPR = ExportSettings()>
<MvIF EXPR = "{p_user NE ''}"> <MvCOMMENT> If we just came from ShowProvideIdentity </MvCOMMENT>
<MvEVAL EXPR = ChooseAdminFunction(p_user,p_pass1)>
<MvELSE>
<MvEVAL EXPR = ChooseAdminFunction(parm_user,parm_pass)>
</MvIF>
<MvEXIT>
</MvIF>
<MvASSIGN NAME = "unwelcomelist" VALUE = "{dirprefix $ '/' $ unwelcome_list}">
<MvASSIGN NAME = "unwelcomelist2" VALUE = "{dirprefix $ '/' $ unwelcome_list2}">
<MvEVAL EXPR = GetSettings()>
<MvEVAL EXPR = DateAndTime()>
<MvEVAL EXPR = SetupLinks()>
</MvFUNCTION>
<MvFUNCTION NAME = "GetFormInput">
<MvASSIGN NAME = "lenny" VALUE = "{len(QUERY_STRING)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{1}">
<MvWHILE EXPR = "{curr_pos LE lenny}">
<MvASSIGN NAME = "a1" VALUE = "{'=' CIN substring(QUERY_STRING,curr_pos,lenny-curr_pos+1)}">
<MvIF EXPR = "{a1 GT 0}">
<MvASSIGN NAME = "a2" VALUE = "{'+' CIN substring(QUERY_STRING,curr_pos+a1,lenny-curr_pos-a1+1)}">
<MvIF EXPR = "{a2 EQ 0}">
<MvASSIGN NAME = "a2" VALUE = "{lenny-curr_pos-a1+2}">
</MvIF>
<MvASSIGN NAME = "x" VALUE = "{substring(QUERY_STRING,curr_pos,a1-1)}">
<MvASSIGN NAME = "&[x]"
VALUE = "{substring(QUERY_STRING,curr_pos+a1,a2-1)}">
</MvIF>
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1 + a2}">
</MvWHILE>
</MvFUNCTION>
<MvFUNCTION NAME = "FindMboardName">
<MvCOMMENT>
The name of the msgboard is what immediately precedes ".mv" in the
document URL, but parsing depends on whether the URL is an NSAPI or CGI URL.
The user must give each message board Miva doc a unique name, e.g. msgboard1.mv,
msgboard2.mv, etc. Each message board will have a separate subdirectory
under mivadata. The subdirectory will be named with the unique message board
name, e.g. msgboard1. The path to the database files, etc. will be based on the
message board name, e.g. mivadata/msgboard1/msgboard.dbf.
If CGI, URL looks like either
.../cgi-bin/miva?xxx.mv+
or
.../cgi-bin/miva?zzz/xxx.mv+
where zzz is the path within the Documents directory (so could have >1 slash).
If NSAPI, URL looks like either
...xxx.mv?
or
...zzz/xxx.mv?
where zzz is the path within the Documents directory (so could have >1 slash).
</MvCOMMENT>
<MvASSIGN NAME = "a1" VALUE = "{'.mv' CIN documenturl}">
<MvASSIGN NAME = "curr_pos" VALUE = "{a1 - 1}">
<MvIF EXPR = "{substring(documenturl,curr_pos+4,1) EQ qmark}">
<MvWHILE EXPR = "{substring(documenturl,curr_pos,1) NE slash}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos - 1}">
</MvWHILE>
<MvELSE>
<MvWHILE EXPR = "{(substring(documenturl,curr_pos,1) NE slash)
AND (substring(documenturl,curr_pos,1) NE qmark)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos - 1}">
</MvWHILE>
</MvIF>
<MvASSIGN NAME = "dirprefix" VALUE = "{substring(documenturl,curr_pos+1,a1-curr_pos-1)}">
<MvASSIGN NAME = "database" VALUE = "{'&[dirprefix];/msgboard.dbf'}"><MvCOMMENT> path name </MvCOMMENT>
<MvASSIGN NAME = "index_file1" VALUE = "{'&[dirprefix];/msgboard1.mvx'}"><MvCOMMENT> path name </MvCOMMENT>
<MvASSIGN NAME = "index_file2" VALUE = "{'&[dirprefix];/msgboard2.mvx'}"><MvCOMMENT> path name </MvCOMMENT>
<MvASSIGN NAME = "index_file3" VALUE = "{'&[dirprefix];/msgboard3.mvx'}"><MvCOMMENT> path name </MvCOMMENT>
<MvASSIGN NAME = "dbname" VALUE = "{'&[dirprefix];'}"><MvCOMMENT> short name </MvCOMMENT>
</MvFUNCTION>
<MvFUNCTION NAME = "SetupLinks">
<MvASSIGN NAME = "link_main_short"
VALUE = "{'[ <a href="&[documenturl];parm_func=showmain+parm_starting_root=1">&[title];</a> ]'}">
<MvASSIGN NAME = "link_main_short_dflt"
VALUE = "{'[ <a href="&[documenturl];parm_func=showmain+parm_starting_root=1">Message Board</a> ]'}">
<MvASSIGN NAME = "link_post_short"
VALUE = "{'[ <a href="&[documenturl];parm_func=showpostform">Post Message</a> ]'}">
<MvASSIGN NAME = "link_search_short"
VALUE = "{'[ <a href="&[documenturl];parm_func=showsearch+parm_starting_root=1">Search</a> ]'}">
<MvASSIGN NAME = "link_faq_short"
VALUE = "{'[ <a href="&[documenturl];parm_func=showfaq">FAQ</a> ]'}">
</MvFUNCTION>
<MvFUNCTION NAME = "GetSettings">
<MvCOMMENT>
Importing a single big field and parsing it into data fields takes
one second. Importing the fields individually takes several seconds.
</MvCOMMENT>
<MvIMPORT FILE = "&[configfile];" DELIMITER = "%%%%%%" FIELDS = "glob">
</MvIMPORT>
<MvASSIGN NAME = "curr_pos" VALUE = "{1}">
<MvEVAL EXPR = ExtractSetting("roots_to_view")>
<MvEVAL EXPR = ExtractSetting("entries_thread")>
<MvEVAL EXPR = ExtractSetting("entries_msgnum")>
<MvEVAL EXPR = ExtractSetting("entries_date")>
<MvEVAL EXPR = ExtractSetting("entries_author")>
<MvEVAL EXPR = ExtractSetting("time_zone")>
<MvEVAL EXPR = ExtractSetting("show_faq")>
<MvEVAL EXPR = ExtractSetting("quote_text")>
<MvEVAL EXPR = ExtractSetting("use_time")>
<MvEVAL EXPR = ExtractSetting("show_preview")>
<MvEVAL EXPR = ExtractSetting("allow_gif")>
<MvEVAL EXPR = ExtractSetting("allow_html_body")>
<MvEVAL EXPR = ExtractSetting("allow_html_subj")>
<MvEVAL EXPR = ExtractSetting("subject_line")>
<MvEVAL EXPR = ExtractSetting("title")>
<MvEVAL EXPR = ExtractSetting("header")>
<MvEVAL EXPR = ExtractSetting("footer")>
<MvASSIGN NAME = "linkline" VALUE = "{substring(glob,curr_pos,len(glob)-curr_pos+1)}">
<MvIF EXPR = "{roots_to_view EQ '0'}">
<MvASSIGN NAME = "roots_to_view" VALUE = "{'1'}">
</MvIF>
<MvASSIGN NAME = "admin_lit" VALUE = "{' Admin'}">
<MvASSIGN NAME = "title2" VALUE = "{title $ admin_lit}">
</MvFUNCTION>
<MvFUNCTION NAME = "ExtractSetting" PARAMETERS = "glob_field">
<MvASSIGN NAME = "a1" VALUE = "{delim CIN substring(glob,curr_pos,len(glob)-curr_pos+1)}">
<MvASSIGN NAME = "&[glob_field];" VALUE = "{substring(glob,curr_pos,a1-1)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1 - 1 + len(delim)}">
</MvFUNCTION>
<MvFUNCTION NAME = "DateAndTime">
<MvCOMMENT> Figure out the date and time of the entry, accounting for the different time zones.
The "time_zone" field is set in admin.</MvCOMMENT>
<MvIF EXPR = "{tm_isdst}"> <MvCOMMENT> If daylight savings </MvCOMMENT>
<MvASSIGN NAME = "time_t" VALUE = "{time_t + 3600}"> <MvCOMMENT> add one hour </MvCOMMENT>
</MvIF>
<MvASSIGN NAME = "month" VALUE = "{time_t_month(time_t,time_zone)}">
<MvASSIGN NAME = "day" VALUE = "{time_t_dayofmonth(time_t,time_zone)}">
<MvASSIGN NAME = "year" VALUE = "{time_t_year(time_t,time_zone)}">
<MvASSIGN NAME = "hour" VALUE = "{time_t_hour(time_t,time_zone)}">
<MvASSIGN NAME = "minute" VALUE = "{time_t_min(time_t,time_zone)}">
<MvASSIGN NAME = "second" VALUE = "{time_t_sec(time_t,time_zone)}">
<MvEVAL EXPR = DateAndTimeMonth()>
<MvIF EXPR = "{minute LT '10'}">
<MvASSIGN NAME = "minute" VALUE = "{'0' $ minute}">
</MvIF>
<MvIF EXPR = "{second LT '10'}">
<MvASSIGN NAME = "second" VALUE = "{'0' $ second}">
</MvIF>
<MvASSIGN NAME = "time" VALUE = "{hour $ ':' $ minute $ ':' $ second}">
<MvASSIGN NAME = "date" VALUE = "{month $ '/' $ day $ '/' $ year}">
<MvCOMMENT> Get rid of any newlines </MvCOMMENT>
<MvASSIGN NAME = "date" VALUE = "{glosub(date,newline,'')}">
<MvASSIGN NAME = "long_date" VALUE = "{monthname $ ' ' $ day $ ', ' $ year $ ' at ' $ hour $ ':' $ minute $ ':' $ second}">
</MvFUNCTION>
<MvFUNCTION NAME = "DateAndTimeMonth">
<MvIF EXPR = "{month EQ '1'}"> <MvASSIGN NAME = "monthname" VALUE = "{'January'}">
<MvELSE>
<MvIF EXPR = "{month EQ '2'}"> <MvASSIGN NAME = "monthname" VALUE = "{'February'}">
<MvELSE>
<MvIF EXPR = "{month EQ '3'}"> <MvASSIGN NAME = "monthname" VALUE = "{'March'}">
<MvELSE>
<MvIF EXPR = "{month EQ '4'}"> <MvASSIGN NAME = "monthname" VALUE = "{'April'}">
<MvELSE>
<MvIF EXPR = "{month EQ '5'}"> <MvASSIGN NAME = "monthname" VALUE = "{'May'}">
<MvELSE>
<MvIF EXPR = "{month EQ '6'}"> <MvASSIGN NAME = "monthname" VALUE = "{'June'}">
<MvELSE>
<MvIF EXPR = "{month EQ '7'}"> <MvASSIGN NAME = "monthname" VALUE = "{'July'}">
<MvELSE>
<MvIF EXPR = "{month EQ '8'}"> <MvASSIGN NAME = "monthname" VALUE = "{'August'}">
<MvELSE>
<MvIF EXPR = "{month EQ '9'}"> <MvASSIGN NAME = "monthname" VALUE = "{'September'}">
<MvELSE>
<MvIF EXPR = "{month EQ '10'}"> <MvASSIGN NAME = "monthname" VALUE = "{'October'}">
<MvELSE>
<MvIF EXPR = "{month EQ '11'}"> <MvASSIGN NAME = "monthname" VALUE = "{'November'}">
<MvELSE> <MvASSIGN NAME = "monthname" VALUE = "{'December'}">
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "RemoveYumlaut" PARAMETERS="infield">
<MvCOMMENT> This subroutine should be physically before any calls to it.
That's because of the following scenario.
Yumlaut, which is ascii 255, means end of file to Miva. If it is
encountered at any point by a Miva script, the script terminates
immediately, whether that is the desired action or not.
Suppose there *is* a yumlaut in an input field. Suppose also that
we think we're prepared for this and we call this Remove function
before we try to use the field for anything. If the code for the
function is physically after the call and the usage of the input
field, the function is not found and the script crashes.
Because the function is not found, the yumlaut in the input field
is not removed. The usage of the field thus still has the yumlaut.
This causes immediate termination of the script at that point.
This in turn causes the code following that point to not be seen,
including this Remove function. Thus the function is not found.
The script crashes because it has a function that doesn't have a
</MvFUNCTION>. This is due to the false end of file, which causes
the function within which the input field is used to end right away,
before any more code is seen, including its </MvFUNCTION>.
</MvCOMMENT>
<MvASSIGN NAME = "curr_pos" VALUE = "{1}">
<MvASSIGN NAME = "lenny" VALUE = "{len(infield)}">
<MvASSIGN NAME = "outfield" VALUE = "{''}">
<MvWHILE EXPR = "{curr_pos LE lenny}">
<MvASSIGN NAME = "a1" VALUE = "{asciichar(255) CIN
substring(infield,curr_pos,lenny-curr_pos+1)}">
<MvIF EXPR = "{a1 GT 0}">
<MvASSIGN NAME = "outfield" VALUE = "{outfield $
substring(infield,curr_pos,a1 - 1)}">
<MvELSE>
<MvASSIGN NAME = "outfield" VALUE = "{outfield $
substring(infield,curr_pos,lenny-curr_pos+1)}">
<MvWHILESTOP>
</MvIF>
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1}">
</MvWHILE>
<MvFUNCRETURN VALUE = "{outfield}"></MvFUNCRETURN>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMain">
<MvIF EXPR = "{dosearch NE ''}">
<MvASSIGN NAME = "search_string" VALUE = "{RemoveYumlaut(search_string)}">
<MvEVAL EXPR = CheckSearchCriteria()>
<MvIF EXPR = "{search_input_error GE '1'}">
<MvEVAL EXPR = ShowSearchForm()>
<MvFUNCRETURN></MvFUNCRETURN>
</MvIF>
</MvIF>
<MvEVAL EXPR = FindStart(roots_to_view,parm_starting_root)>
<MvEVAL EXPR = MainPageHeader()>
<MvEVAL EXPR = MainPageBody()>
<MvEVAL EXPR = MainPageFooter()> <MvCOMMENT> Doesn't include post form </MvCOMMENT>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "CheckSearchCriteria">
<MvIF EXPR = "{(use_searchstring EQ '' AND use_startdate EQ '' AND use_enddate EQ '')}">
<MvASSIGN NAME = "search_input_error" VALUE = "{'1'}">
<MvELSE>
<MvIF EXPR = "{(use_searchstring NE '' AND search_string EQ '')
OR (use_startdate NE '' AND start_month EQ '' AND start_day EQ '' AND start_year EQ '')
OR (use_enddate NE '' AND end_month EQ '' AND end_day EQ '' AND end_year EQ '')}">
<MvASSIGN NAME = "search_input_error" VALUE = "{'2'}">
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "FindStart" PARAMETERS = "rootstoview,startingroot">
<MvIF EXPR = "{db_just_created EQ '1'}"> <MvCOMMENT> 1st record, super-root not visible yet. </MvCOMMENT>
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
<MvASSIGN NAME = "starting_recno" VALUE = "{'0'}">
<MvASSIGN NAME = "last_rootnum" VALUE = "{'0'}">
<MvFUNCRETURN></MvFUNCRETURN>
</MvIF>
<MvASSIGN NAME = "starting_root" VALUE = "{startingroot}">
<MvASSIGN NAME = "starting_root_save" VALUE = "{startingroot}">
<MvIF EXPR = "{starting_root EQ ''}">
<MvASSIGN NAME = "starting_root" VALUE = "{'1'}">
</MvIF>
<MvCOMMENT> Find main posting to start page with. </MvCOMMENT>
<MvEVAL EXPR = FindDirection()>
<MvIF EXPR = "{dosearch EQ '' AND nextmatch EQ '' AND prevmatch EQ ''}">
<MvEVAL EXPR = FindStartingRoot(rootstoview)>
<MvEVAL EXPR = FindStartingRec(rootstoview)>
<MvELSE>
<MvEVAL EXPR = FindStartingRootSearch(rootstoview)>
<MvEVAL EXPR = FindStartingRecSearch()>
</MvIF>
<MvEVAL EXPR = FindScrolling(rootstoview)>
</MvFUNCTION>
<MvFUNCTION NAME = "FindDirection">
<MvIF EXPR = "{parm_starting_root NE ''}">
<MvIF EXPR = "{backintime NE '' OR nextmatch NE ''}">
<MvASSIGN NAME = "direction" VALUE = "{'back'}">
<MvELSE>
<MvIF EXPR = "{forwardintime NE '' OR prevmatch NE ''}">
<MvASSIGN NAME = "direction" VALUE = "{'forward'}">
</MvIF>
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "FindStartingRoot" PARAMETERS = "rootstoview">
<MvIF EXPR = "{direction EQ 'back'}">
<MvIF EXPR = "{form_num_displayed EQ ''}">
<MvASSIGN NAME = "starting_root" VALUE = "{starting_root + rootstoview}">
<MvELSE>
<MvASSIGN NAME = "starting_root" VALUE = "{starting_root + form_num_displayed}">
</MvIF>
<MvELSE>
<MvIF EXPR = "{parm_starting_root EQ ''}"> <MvCOMMENT> First time in, no direction specified. </MvCOMMENT>
<MvASSIGN NAME = "starting_root" VALUE = "{'1'}">
<MvELSE>
<MvIF EXPR = "{direction EQ 'forward'}">
<MvIF EXPR = "{starting_root GT rootstoview}">
<MvASSIGN NAME = "starting_root" VALUE = "{starting_root - rootstoview}">
<MvELSE>
<MvASSIGN NAME = "partial_page" VALUE = "{'1'}">
<MvASSIGN NAME = "starting_root" VALUE = "{'1'}">
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "FindStartingRootSearch" PARAMETERS = "rootstoview">
<MvCOMMENT> First time in, start at top of database, else at current pagetop. </MvCOMMENT>
<MvIF EXPR = "{parm_starting_root EQ '' OR dosearch NE ''}">
<MvASSIGN NAME = "starting_root" VALUE = "{'0'}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "FindStartingRec" PARAMETERS = "rootstoview">
<MvCOMMENT> Find record number of root that will start page. </MvCOMMENT>
<MvEVAL EXPR = GetSuperRoot()>
<MvSKIP ROWS = starting_root - 1>
<MvASSIGN NAME = "starting_recno" VALUE = "{&[dbname];.d.recno}">
<MvASSIGN NAME = "starting_seqnum" VALUE = "{dbseqnum}">
<MvCLOSE NAME = "&[dbname];">
</MvFUNCTION>
<MvFUNCTION NAME = "GetSuperRoot">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];">
<MvGO ROW = 1>
<MvASSIGN NAME = "last_rootnum" VALUE = "{dbparentno}">
<MvIF EXPR = "{last_rootnum GT 0}">
<MvASSIGN NAME = "roots_exist" VALUE = "{'1'}">
<MvELSE>
<MvASSIGN NAME = "roots_exist" VALUE = "{'0'}">
</MvIF>
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbparentno EQ super_root AND NOT &[dbname];.d.deleted}">
</MvFUNCTION>
<MvFUNCTION NAME = "FindScrolling" PARAMETERS = "rootstoview">
<MvCOMMENT> Determine which scrolling options make sense, if any. </MvCOMMENT>
<MvIF EXPR = "{direction EQ 'forward' AND partial_page NE ''}">
<MvCOMMENT> Starting value of roots_displayed_count > 0 since displaying partial page. </MvCOMMENT>
<MvASSIGN NAME = "roots_displayed_count" VALUE = "{rootstoview - starting_root_save + 1}">
<MvASSIGN NAME = "num_displayed" VALUE = "{starting_root_save - 1}">
<MvELSE>
<MvASSIGN NAME = "roots_displayed_count" VALUE = "{'0'}">
<MvIF EXPR = "{last_rootnum - starting_root GE rootstoview}">
<MvASSIGN NAME = "num_displayed" VALUE = "{rootstoview}">
<MvELSE>
<MvASSIGN NAME = "num_displayed" VALUE = "{last_rootnum - starting_root + 1}">
</MvIF>
</MvIF>
<MvASSIGN NAME = "ending_root" VALUE = "{starting_root + num_displayed - 1}">
<MvIF EXPR = "{roots_exist EQ '1'}">
<MvIF EXPR = "{ending_root EQ last_rootnum}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
<MvELSE>
<MvASSIGN NAME = "is_last_page" VALUE = "{'0'}">
</MvIF>
<MvELSE>
<MvCOMMENT> Almost empty database </MvCOMMENT>
<MvASSIGN NAME = "starting_recno" VALUE = "{'1'}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "FindStartingRecSearch">
<MvCOMMENT> Find record number of root that will start page, whether 1st search or
search for next match. For 1st search, starting_root s/b zero.
Get root count from super_root's parent field.
</MvCOMMENT>
<MvEVAL EXPR = GetSuperRoot()>
<MvASSIGN NAME = "root_count" VALUE = "{'0'}">
<MvASSIGN NAME = "match_found" VALUE = "{'0'}">
<MvIF EXPR = "{prevmatch EQ ''}">
<MvWHILE EXPR = "{NOT &[dbname];.d.eof}">
<MvIF EXPR = "{match_found EQ '0'}">
<MvASSIGN NAME = "root_count" VALUE = "{root_count + 1}">
<MvIF EXPR = "{root_count GT starting_root}">
<MvIF EXPR = "{use_startdate NE '' OR use_enddate NE ''}">
<MvEVAL EXPR = ExtractDateFields()>
</MvIF>
<MvEVAL EXPR = SeeIfMatch()>
<MvIF EXPR = "{match_found EQ '1'}">
<MvASSIGN NAME = "starting_recno" VALUE = "{&[dbname];.d.recno}">
<MvASSIGN NAME = "starting_root" VALUE = "{root_count}">
<MvWHILESTOP></MvWHILESTOP>
</MvIF>
</MvIF>
</MvIF>
<MvSKIP>
</MvWHILE>
<MvELSE>
<MvEVAL EXPR = DoPreviousMatch()>
</MvIF>
<MvIF EXPR = "{match_found EQ '0'}">
<MvIF EXPR = "{starting_recno_save NE ''}">
<MvASSIGN NAME = "starting_recno" VALUE = "{starting_recno_save}">
<MvELSE>
<MvASSIGN NAME = "starting_recno" VALUE = "{'1'}">
</MvIF>
</MvIF>
<MvCLOSE NAME = "&[dbname];">
</MvFUNCTION>
<MvFUNCTION NAME = "DoPreviousMatch">
<MvCOMMENT> First go forward to find starting point. Start backward from
there and look for match. </MvCOMMENT>
<MvWHILE EXPR = "{NOT &[dbname];.d.eof}">
<MvASSIGN NAME = "root_count" VALUE = "{root_count + 1}">
<MvIF EXPR = "{root_count EQ starting_root}">
<MvASSIGN NAME = "starting_recno" VALUE = "{&[dbname];.d.recno}">
<MvWHILESTOP></MvWHILESTOP>
</MvIF>
<MvSKIP>
</MvWHILE>
<MvSKIP ROWS = -1> <MvCOMMENT> Back up 1 from curr rec so don't match on it again.</MvCOMMENT>
<MvWHILE EXPR = "{NOT &[dbname];.d.eof}">
<MvIF EXPR = "{match_found EQ '0'}">
<MvASSIGN NAME = "root_count" VALUE = "{root_count - 1}">
<MvIF EXPR = "{use_startdate NE '' OR use_enddate NE ''}">
<MvEVAL EXPR = ExtractDateFields()>
</MvIF>
<MvEVAL EXPR = SeeIfMatch()>
<MvIF EXPR = "{match_found EQ '1'}">
<MvASSIGN NAME = "starting_recno" VALUE = "{&[dbname];.d.recno}">
<MvASSIGN NAME = "starting_root" VALUE = "{root_count}">
<MvWHILESTOP></MvWHILESTOP>
</MvIF>
</MvIF>
<MvCOMMENT> If we're at beginning of index, i.e. recno 1, stop. </MvCOMMENT>
<MvSKIP ROWS = -1>
</MvWHILE>
</MvFUNCTION>
<MvFUNCTION NAME = "ExtractDateFields">
<MvASSIGN NAME = "a1" VALUE = "{'/' CIN dbdate}">
<MvIF EXPR = "{a1 EQ '2'}">
<MvASSIGN NAME = "db_month" VALUE = "{'0' $ substring(dbdate,1,1)}">
<MvELSE>
<MvASSIGN NAME = "db_month" VALUE = "{substring(dbdate,1,2)}">
</MvIF>
<MvASSIGN NAME = "a2" VALUE = "{'/' CIN substring(dbdate,a1+1,10-a1)}">
<MvIF EXPR = "{a2 EQ '2'}">
<MvASSIGN NAME = "db_day" VALUE = "{'0' $ substring(dbdate,a1+1,1)}">
<MvELSE>
<MvASSIGN NAME = "db_day" VALUE = "{substring(dbdate,a1+1,2)}">
</MvIF>
<MvASSIGN NAME = "db_year" VALUE = "{substring(dbdate,a1+a2+1,4)}">
</MvFUNCTION>
<MvFUNCTION NAME = "SeeIfMatch">
<MvIF EXPR = "{ (use_searchstring EQ '' OR search_string CIN dbsubject)
AND (use_startdate EQ ''
OR start_year LT db_year
OR (start_year EQ db_year
AND (start_month LT db_month)
OR (start_month EQ db_month
AND start_day LE db_day)))
AND (use_enddate EQ ''
OR db_year LT end_year
OR (db_year EQ end_year
AND (db_month LT end_month)
OR (db_month EQ end_month
AND db_day LE end_day)))
}">
<MvASSIGN NAME = "match_found" VALUE = "{'1'}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "MainPageHeader">
&[ON];&[header];<h1 align="center">&[title];</h1>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
<MvIF EXPR = "{dosearch NE '' OR nextmatch NE '' OR prevmatch NE ''}">
<MvIF EXPR = "{match_found EQ '0'}">
&[ON];<center><font color="#ff0000" size = "+1">Match not found.</font></center><br>&[crlf];&[OFF];
<MvELSE>
&[ON];<center><font color="#ff0000" size = "+1">Match found:</font></center><br>&[crlf];&[OFF];
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "MainPageBody">
<MvCOMMENT>
Each posting which is not a followup is the root of a tree of postings. To tie all
of these roots together, we use an artificial posting called the super-root. It
forms the root of a tree or hierarchy. Its children are the original roots. Their
children, if any, are their followups. To display the overall hierarchy of postings
in most-recent-first sequence, we traverse the overall tree recursively. To do so, we
start at the super-root and print its "followups" (postings which are *not* followups).
While processing a posting, we print *its* followups, etc., recursively traversing
the hierarchy of postings and followups in most-recent-first sequence.
Additionally, we don't just print the whole database. We only print a limited number
of postings at a time. Other postings can be viewed by "scrolling" forward or
backward in time. A practical way to limit the amount of material to display
at a time is to pick a fixed number of roots to display postings for. This
prevents us from cutting off a set of related postings under one root. Rather,
we finish the set of postings related to a root. So, the exact number of
postings per page will fluctuate, though the number of *roots* is fixed. The
scrolling amount can be set in the administration function of the message board.
The amount is called "roots_to_view".
</MvCOMMENT>
<MvASSIGN NAME = "traverse_function" VALUE = "{'AddLine'}">
<MvASSIGN NAME = "starting_nestlvl" VALUE = "{'0'}">
<MvASSIGN NAME = "roots_per_page" VALUE = "{roots_to_view}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
&[ON]<BLOCKQUOTE>&[OFF]
<MvEVAL EXPR = TraverseTree(parm_admin_flag,parm_user,parm_pass)> <MvCOMMENT> Start recursion </MvCOMMENT>
<MvEVAL EXPR = Unindent()>
<MvCLOSE NAME = "&[dbname];">
</MvFUNCTION>
<MvFUNCTION NAME = "TraverseTree" PARAMETERS = "admin,uname,pass">
<MvCOMMENT>
The following example should help one visualize this processing. Suppose the
messsage board has 10 postings so far, numbered 1 to 10, the oldest being 1.
There would 11 records in the database, the eleventh being the super-root.
Suppose the posting structure should print out like this:
4
10
5
8
9
6
7
3
1
2
The records are in exactly this hierarchical and most-recent-first sequence
within the database because the index used here is decreasing sequence number.
Sequence number for a posting is midway between the preceding and following
postings' sequence numbers. This speeds up displaying the list as it looks above.
</MvCOMMENT>
<MvCOMMENT> Start at beginning of database, or at starting point if scrolling,
according to index 1 (sequence number). </MvCOMMENT>
<MvIF EXPR = "{dosearch NE '' AND match_found EQ '0'}">
<MvGO ROW = "top">
<MvSKIP>
<MvELSE>
<MvGO ROW = starting_recno>
<MvIF EXPR = "{dbselfnum EQ super_root}">
<MvSKIP>
</MvIF>
</MvIF>
<MvIF EXPR = "{traverse_reason EQ 'followups'}">
<MvSKIP>
<MvIF EXPR = "{dbnestlvl LE starting_nestlvl}">
<MvFUNCRETURN></MvFUNCRETURN>
</MvIF>
</MvIF>
<MvASSIGN NAME = "save_nestlvl" VALUE = "{starting_nestlvl}">
<MvIF EXPR = "{currself EQ (1 + big_bump)}"> <MvCOMMENT> 1st record, super-root not visible yet. </MvCOMMENT>
<MvEVAL EXPR = TravTreeFirstrec(admin,uname,pass)>
<MvELSE>
<MvWHILE EXPR = "{NOT &[dbname];.d.eof
AND (roots_displayed_count LT roots_per_page
OR (roots_displayed_count EQ roots_per_page
AND dbparentno NE super_root))}">
<MvEVAL EXPR = &[traverse_function];(admin,uname,pass)>
<MvIF EXPR = "{dbparentno EQ super_root}">
<MvASSIGN NAME = "roots_displayed_count" VALUE = "{roots_displayed_count + 1}">
</MvIF>
<MvSKIP>
<MvIF EXPR = "{dbnestlvl LE starting_nestlvl}">
<MvWHILESTOP></MvWHILESTOP>
</MvIF>
</MvWHILE>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "TravTreeFirstrec" PARAMETERS = "admin,uname,pass">
<MvASSIGN NAME = "dbselfnum" VALUE = "{currself}">
<MvASSIGN NAME = "dbnumdesc" VALUE = "{'0'}">
<MvASSIGN NAME = "dbdate" VALUE = "{date}">
<MvASSIGN NAME = "dbtime" VALUE = "{time}">
<MvASSIGN NAME = "dbname1" VALUE = "{name}">
<MvASSIGN NAME = "dbsubject" VALUE = "{subject}">
<MvEVAL EXPR = &[traverse_function];(admin,uname,pass)>
</MvFUNCTION>
<MvFUNCTION NAME = "AddLine" PARAMETERS = "admin,uname,pass">
<MvIF EXPR = "{use_time EQ 'on'}">
<MvASSIGN NAME = "print_date" VALUE = "{dbtime $ ' ' $ dbdate}">
<MvELSE>
<MvASSIGN NAME = "print_date" VALUE = "{dbdate}">
</MvIF>
<MvASSIGN NAME = "indent_string" VALUE = "{''}">
<MvASSIGN NAME = "indent_count" VALUE = "{dbnestlvl - save_nestlvl}">
<MvIF EXPR = "{indent_count GT 0}">
<MvASSIGN NAME = "indent_string" VALUE = "{'<UL>'}">
<MvELSE>
<MvIF EXPR = "{indent_count LT 0}">
<MvWHILE EXPR = "{indent_count LT 0}">
<MvASSIGN NAME = "indent_string" VALUE = "{indent_string $ '</UL>'}">
<MvASSIGN NAME = "indent_count" VALUE = "{indent_count + 1}">
</MvWHILE>
<MvELSE>
<MvASSIGN NAME = "indent_string" VALUE = "{''}">
</MvIF>
</MvIF>
<MvASSIGN NAME = "save_nestlvl" VALUE = "{dbnestlvl}">
&[ON]&[indent_string];<LI>&[OFF]
<MvIF EXPR = "{admin EQ 'y'}">
&[ON];<a href = "&[documenturl];parm_func=showmsg+parm_msgnum=&[dbselfnum];+parm_admin_flag=&[admin];+parm_user=&[uname];+parm_pass=&[pass];">&[OFF];
<MvELSE>
&[ON];<a href = "&[documenturl];parm_func=showmsg+parm_msgnum=&[dbselfnum];">&[OFF];
</MvIF>
&[ON];&[dbsubject];</a> - <b>&[dbname1]; &[crlf];&[OFF];
&[ON];</b><i>&[print_date];</i> (&[dbnumdesc];)&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "Unindent">
<MvASSIGN NAME = "unindent_string" VALUE = "{''}">
<MvWHILE EXPR = "{save_nestlvl GT 0}">
<MvASSIGN NAME = "unindent_string" VALUE = "{unindent_string $ '</UL>'}">
<MvASSIGN NAME = "save_nestlvl" VALUE = "{save_nestlvl - 1}">
</MvWHILE>
&[ON]&[unindent_string];</BLOCKQUOTE>&[OFF]
</MvFUNCTION>
<MvFUNCTION NAME = "MainPageFooter">
<MvCOMMENT> If first page, no previous button. If last page, no next button.
Except when we're first coming in to message board, and it's page 1,
starting root in url reflects page we're coming *from*, not page we're on.
</MvCOMMENT>
<MvIF EXPR = "{starting_root EQ '0'}">
<MvASSIGN NAME = "starting_root" VALUE = "{'1'}">
</MvIF>
&[ON];<CENTER>&[crlf];&[OFF];
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];<form method="post" action="&[documenturl];parm_func=showmain+parm_starting_root=&[starting_root];+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
<MvELSE>
&[ON];<form method="post" action="&[documenturl];parm_func=showmain+parm_starting_root=&[starting_root];">&[crlf];&[OFF];
</MvIF>
&[ON];<input type = "hidden" name = "form_num_displayed" value = &[num_displayed];></INPUT>&[crlf];&[OFF];
&[ON];<input type = "hidden" name = "starting_recno_save" value = &[starting_recno];></INPUT>&[crlf];&[OFF];
<MvIF EXPR = "{(is_last_page NE '1') AND (starting_root LT last_rootnum)}">
&[ON];<input name="backintime" type="submit" value="Next Page"></INPUT>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{starting_root GT '1'}">
&[ON];<input name="forwardintime" type="submit" value="Previous Page"></INPUT>&[crlf];&[OFF];
</MvIF>
<MvEVAL EXPR = SearchFields()>
&[ON];</form></CENTER>&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];&[banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "SearchFields">
<MvIF EXPR = "{(dosearch NE '' AND match_found EQ '1') OR search_started NE ''}">
<MvIF EXPR = "{nextmatch NE '' AND (match_found EQ '0' OR starting_root GE last_rootnum)}">
<MvELSE>
&[ON];<input name="nextmatch" type="submit" value="Next Match"></INPUT>&[crlf];&[OFF];
<MvASSIGN NAME = "button_out" VALUE = "{'1'}">
</MvIF>
<MvIF EXPR = "{(dosearch NE '') OR (prevmatch NE '' AND match_found EQ '0') OR (starting_root LE '1')}">
<MvELSE>
&[ON];<input name="prevmatch" type="submit" value="Previous Match"></INPUT>&[crlf];&[OFF];
<MvASSIGN NAME = "button_out" VALUE = "{'1'}">
</MvIF>
<MvIF EXPR = "{button_out EQ '1'}">
&[ON];<input name="search_started" type="hidden" value="'1'"></INPUT>&[crlf];&[OFF];
&[ON];<input name="use_searchstring" type="hidden" value="&[use_searchstring];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="use_startdate" type="hidden" value="&[use_startdate];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="use_enddate" type="hidden" value="&[use_enddate];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="search_string" type="hidden" value="&[search_string];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="start_month" type="hidden" value="&[start_month];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="start_day" type="hidden" value="&[start_day];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="start_year" type="hidden" value="&[start_year];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="end_month" type="hidden" value="&[end_month];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="end_day" type="hidden" value="&[end_day];"></INPUT>&[crlf];&[OFF];
&[ON];<input name="end_year" type="hidden" value="&[end_year];"></INPUT>&[crlf];&[OFF];
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "LinkLine" PARAMETERS = "admin,uname,pass">
<MvEVAL EXPR = GeneralLinkLineParms(admin,uname,pass)>
&[ON];&[general_data_area];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "GeneralLinkLineParms" PARAMETERS = "admin,uname,pass">
<MvEVAL EXPR = GenLinkLineIntro(admin,uname,pass)>
<MvEVAL EXPR = GenLinkLineParmsFaqShort()>
<MvEVAL EXPR = GenLinkLineParmsShowpostform(admin)>
<MvEVAL EXPR = GenLinkLineParmsShowmain(admin)>
<MvEVAL EXPR = GenLinkLineParmsShowsearch(admin)>
<MvEVAL EXPR = GenLinkLineParmsShowFaq(admin)>
<MvEVAL EXPR = GenLinkLineParmsFinishLinks()>
<MvEVAL EXPR = GenLinkLineParmsWrapup(admin)>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineIntro" PARAMETERS = "admin,uname,pass">
<MvASSIGN NAME = "data_area" VALUE = "{linkline}">
<MvASSIGN NAME = "link_admin"
VALUE = "{'[ <a href="&[documenturl];parm_func=admin+parm_admin_func=null'
$ '+parm_user=&[uname];+parm_pass=&[pass];'
$ '">&[title2];</a> ]'}">
<MvASSIGN NAME = "extra_parms" VALUE = "{'+parm_admin_flag=&[admin];+parm_user=&[uname];+parm_pass=&[pass];'}">
<MvASSIGN NAME = "curr_pos" VALUE = "{'1'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{''}">
<MvASSIGN NAME = "a1" VALUE = "{'[' CIN data_area}">
<MvIF EXPR = "{(a1 GT '0')}">
<MvASSIGN NAME = "general_data_area" VALUE = "{substring(data_area,1,a1-1)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{a1}">
</MvIF>
<MvIF EXPR = "{showing_message EQ 1}">
<MvASSIGN NAME = "general_data_area"
VALUE = "{general_data_area $ '[ <a href="#followups">Followups</a> ] '
$ '[ <a href="#postfollowup">Post Followup</a> ] '}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineParmsFaqShort">
<MvCOMMENT> Omit faq link if not to be shown </MvCOMMENT>
<MvASSIGN NAME = "a1" VALUE = "{link_faq_short CIN data_area}">
<MvIF EXPR = "{(a1 GT '0') AND (show_faq NE 'on')}">
<MvASSIGN NAME = "data_area" VALUE = "{substring(data_area,1,a1-1)
$ substring(data_area,a1+len(link_faq_short),len(data_area)-(a1+len(link_faq_short)-1))}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineParmsShowpostform" PARAMETERS = "admin">
<MvASSIGN NAME = "a1" VALUE = "{'parm_func=showpostform' CIN substring(data_area,curr_pos,len(data_area)-curr_pos+1)}">
<MvIF EXPR = "{a1 GT '0'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ substring(data_area,curr_pos,a1+21)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1+21}">
<MvIF EXPR = "{admin EQ 'y'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ extra_parms}">
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineParmsShowmain" PARAMETERS = "admin">
<MvASSIGN NAME = "a1" VALUE = "{'parm_func=showmain+parm_starting_root=1' CIN substring(data_area,curr_pos,len(data_area)-curr_pos+1)}">
<MvIF EXPR = "{a1 GT '0'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ substring(data_area,curr_pos,a1+38)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1+38}">
<MvIF EXPR = "{admin EQ 'y'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ extra_parms}">
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineParmsShowsearch" PARAMETERS = "admin">
<MvASSIGN NAME = "a1" VALUE = "{'parm_func=showsearch+parm_starting_root=1' CIN substring(data_area,curr_pos,len(data_area)-curr_pos+1)}">
<MvIF EXPR = "{a1 GT '0'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ substring(data_area,curr_pos,a1+40)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1+40}">
<MvIF EXPR = "{admin EQ 'y'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ extra_parms}">
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineParmsShowfaq" PARAMETERS = "admin">
<MvASSIGN NAME = "a1" VALUE = "{'parm_func=showfaq' CIN substring(data_area,curr_pos,len(data_area)-curr_pos+1)}">
<MvIF EXPR = "{a1 GT '0'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ substring(data_area,curr_pos,a1+16)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1+16}">
<MvIF EXPR = "{admin EQ 'y'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ extra_parms}">
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineParmsFinishLinks">
<MvASSIGN NAME = "a1" VALUE = "{']' CIN substring(data_area,curr_pos,len(data_area)-curr_pos+1)}">
<MvIF EXPR = "{a1 GT '0'}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ substring(data_area,curr_pos,a1)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "GenLinkLineParmsWrapup" PARAMETERS = "admin">
<MvIF EXPR = "{admin EQ 'y' AND data_area NE ''}">
<MvASSIGN NAME = "general_data_area" VALUE = "{general_data_area $ ' ' $ link_admin}">
</MvIF>
<MvIF EXPR = "{curr_pos LE len(data_area)}">
<MvASSIGN NAME = "general_data_area"
VALUE = "{general_data_area $ substring(data_area,curr_pos,len(data_area)-curr_pos+1)}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "PostControl">
<MvEVAL EXPR = SeeIfBlocked()>
<MvIF EXPR = "{blocked_ip EQ '1'}">
<MvEVAL EXPR = Error("blocked_ip")>
<MvFUNCRETURN></MvFUNCRETURN>
</MvIF>
<MvEVAL EXPR = EditInput()>
<MvEVAL EXPR = UpdateDatabase()>
<MvEVAL EXPR = BuildMessageFile()>
<MvEVAL EXPR = ReturnHtml()>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "SeeIfBlocked">
<MvCOMMENT>
If visitor's IP in unwelcome list, go no further.
Use &[REMOTE_ADDR];. Import unwelcome list file, check for match.
</MvCOMMENT>
<MvASSIGN NAME = "blocked_ip" VALUE = "{0}">
<MvIF EXPR = "{fexists(unwelcomelist)}">
<MvIMPORT FILE = "&[unwelcomelist];" FIELDS = "ip" DELIMITER = "">
<MvIF EXPR = "{'*' CIN ip}">
<MvIF EXPR = "{gettoken(ip,'*',1) CIN &[REMOTE_ADDR];}">
<MvASSIGN NAME = "blocked_ip" VALUE = "{1}">
<MvIMPORTSTOP></MvIMPORTSTOP>
</MvIF>
<MvELSE>
<MvIF EXPR = "{&[REMOTE_ADDR]; EQ ip}">
<MvASSIGN NAME = "blocked_ip" VALUE = "{1}">
<MvIMPORTSTOP></MvIMPORTSTOP>
</MvIF>
</MvIF>
</MvIMPORT>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "EditInput">
<MvASSIGN NAME = "form_name" VALUE = "{RemoveYumlaut(form_name)}">
<MvASSIGN NAME = "form_email" VALUE = "{RemoveYumlaut(form_email)}">
<MvASSIGN NAME = "form_subject" VALUE = "{RemoveYumlaut(form_subject)}">
<MvASSIGN NAME = "form_body" VALUE = "{RemoveYumlaut(form_body)}">
<MvASSIGN NAME = "form_url" VALUE = "{RemoveYumlaut(form_url)}">
<MvASSIGN NAME = "form_url_title" VALUE = "{RemoveYumlaut(form_url_title)}">
<MvASSIGN NAME = "form_img" VALUE = "{RemoveYumlaut(form_img)}">
<MvIF EXPR = "{parm_followup_to NE ''}">
<MvASSIGN NAME = "is_followup" VALUE = "{'1'}">
<MvELSE>
<MvASSIGN NAME = "is_followup" VALUE = "{'0'}">
</MvIF>
<MvIF EXPR = "{form_name NE ''}">
<MvEVAL EXPR = EditInputName()>
<MvELSE>
<MvEVAL EXPR = Error("no_name")>
</MvIF>
<MvASSIGN NAME = "a1" VALUE = "{atsign IN form_email}">
<MvIF EXPR = "{a1 GT 0}">
<MvIF EXPR = "{period IN substring(form_email,a1+1,len(form_email)-a1)}">
<MvASSIGN NAME = "email" VALUE = "{ConvertTags(form_email)}">
</MvIF>
</MvIF>
<MvEVAL EXPR = EditInputSubject()>
<MvEVAL EXPR = EditInputBody()>
<MvASSIGN NAME = "a1" VALUE = "{':' IN form_url}">
<MvASSIGN NAME = "a2" VALUE = "{period IN form_url}">
<MvIF EXPR = "{a1 GT 0 AND a2 GT 0 AND a1 LT a2 AND form_url_title NE ''}">
<MvASSIGN NAME = "message_url" VALUE = "{ConvertTags(form_url)}">
<MvASSIGN NAME = "message_url_title" VALUE = "{ConvertTags(form_url_title)}">
</MvIF>
<MvASSIGN NAME = "a1" VALUE = "{'tp://' IN form_img}">
<MvASSIGN NAME = "a2" VALUE = "{period IN form_img}">
<MvIF EXPR = "{a1 GT 0 AND a2 GT 0 AND a1 LT a2}">
<MvASSIGN NAME = "message_img" VALUE = "{ConvertTags(form_img)}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "EditInputName">
<MvASSIGN NAME = "curr_pos" VALUE = "{1}">
<MvASSIGN NAME = "len_limit" VALUE = "{len(form_name)}">
<MvWHILE EXPR = "{curr_pos LE len_limit}">
<MvASSIGN NAME = "curr_char" VALUE = "{substring(form_name,curr_pos,1)}">
<MvIF EXPR = "{NOT isalpha(curr_char)
AND curr_char NE '0'
AND curr_char NE '1'
AND curr_char NE '2'
AND curr_char NE '3'
AND curr_char NE '4'
AND curr_char NE '5'
AND curr_char NE '6'
AND curr_char NE '7'
AND curr_char NE '8'
AND curr_char NE '9'
AND curr_char NE ' '
AND curr_char NE '_'}">
<MvASSIGN NAME = "form_name" VALUE = "{ConvertTags(form_name)}">
<MvEVAL EXPR = Error("bad_char_in_name")>
</MvIF>
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + 1}">
</MvWHILE>
<MvASSIGN NAME = "name" VALUE = "{form_name}">
</MvFUNCTION>
<MvFUNCTION NAME = "EditInputSubject">
<MvIF EXPR = "{form_subject NE ''}">
<MvASSIGN NAME = "subject" VALUE = "{glosub(form_subject,'\cM','')}">
<MvCOMMENT>Remove any anchors from subject, since it goes in an anchor on main page.</MvCOMMENT>
<MvASSIGN NAME = "work_subject" VALUE = "{''}">
<MvASSIGN NAME = "a1" VALUE = "{'<a href' CIN subject}">
<MvASSIGN NAME = "a1_abs" VALUE = "{a1}">
<MvASSIGN NAME = "a2_abs" VALUE = "{'1'}">
<MvASSIGN NAME = "curr_pos" VALUE = "{'1'}">
<MvASSIGN NAME = "lenny" VALUE = "{len(subject)}">
<MvWHILE EXPR = "{a1 GT 0}">
<MvASSIGN NAME = "a2" VALUE = "{'</a>' CIN
substring(subject,a1_abs,lenny - a1_abs + 1)}">
<MvASSIGN NAME = "a2_abs" VALUE = "{a2 + a1_abs - 1}">
<MvASSIGN NAME = "work_subject" VALUE = "{work_subject $
substring(subject,curr_pos,a1_abs - curr_pos)}">
<MvASSIGN NAME = "curr_pos" VALUE = "{a2_abs + 4}">
<MvASSIGN NAME = "a1" VALUE = "{'<a href' CIN
substring(subject,a2_abs,lenny - a2_abs + 1)}">
<MvASSIGN NAME = "a1_abs" VALUE = "{a1 + a2_abs - 1}">
</MvWHILE>
<MvCOMMENT>Copy part of subject following last anchor, if any.
Replace subject with anchor-free version.</MvCOMMENT>
<MvIF EXPR = "{curr_pos GT 1}">
<MvIF EXPR = "{curr_pos GT lenny}">
<MvEVAL EXPR = Error("link_subject")>
<MvELSE>
<MvASSIGN NAME = "work_subject" VALUE = "{work_subject $
substring(subject,curr_pos,lenny-curr_pos+1)}">
<MvASSIGN NAME = "subject" VALUE = "{work_subject}">
</MvIF>
</MvIF>
<MvIF EXPR = "{'<font' CIN subject}">
<MvIF EXPR = "{'</font' CIN subject}">
<MvELSE>
<MvASSIGN NAME = "subject" VALUE = "{subject $ '</font>'}">
</MvIF>
</MvIF>
<MvIF EXPR = "{'SCRIPT LANGUAGE' CIN subject}">
<MvASSIGN NAME = "foo" VALUE = "{'SCRIPT LANGUAGE' CIN subject}">
<MvASSIGN NAME = "subject" VALUE = "{substring(subject,0,foo-1) $ substring(subject,foo+16,len(subject)-foo)}">
</MvIF>
<MvIF EXPR = "{allow_html_subj NE 'on' OR 'MvEVAL' CIN subject}">
<MvASSIGN NAME = "subject" VALUE = "{ConvertTags(subject)}">
</MvIF>
<MvELSE>
<MvEVAL EXPR = Error("no_subject")>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "EditInputBody">
<MvIF EXPR = "{form_body NE ''}">
<MvASSIGN NAME = "body" VALUE = "{glosub(form_body,'\cM','')}">
<MvIF EXPR = "{allow_html_body NE 'on' OR 'MvEVAL' CIN body}">
<MvASSIGN NAME = "body" VALUE = "{ConvertTags(body)}">
</MvIF>
<MvIF EXPR = "{allow_html_body EQ 'on'}">
<MvIF EXPR = "{'<font' CIN body}">
<MvIF EXPR = "{'</font' CIN body}">
<MvELSE>
<MvASSIGN NAME = "body" VALUE = "{body $ '</font>'}">
</MvIF>
</MvIF>
<MvIF EXPR = "{'SCRIPT LANGUAGE' CIN body}">
<MvASSIGN NAME = "foo" VALUE = "{'SCRIPT LANGUAGE' CIN body}">
<MvASSIGN NAME = "body" VALUE = "{substring(body,0,foo-1) $ substring(body,foo+16,len(body)-foo)}">
</MvIF>
</MvIF>
<MvASSIGN NAME = "body" VALUE = "{glosub(body,crlf,'<br>')}">
<MvASSIGN NAME = "body" VALUE = "{glosub(body,'<p>','<br>')}">
<MvELSE>
<MvEVAL EXPR = Error("no_body")>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "UpdateDatabase">
<MvWHILE EXPR = "{fexists('&[dirprefix];/lockfile')}"></MvWHILE>
<MvEXPORT FILE = "&[dirprefix];/lockfile" FIELDS = "" DELIMITER = "">
<MvLOCKFILE FILE = "&[database];">
<MvLOCKFILE FILE = "&[index_file2];">
<MvLOCKFILE FILE = "&[index_file1];">
<MvLOCKFILE FILE = "&[index_file3];">
<MvIF EXPR = "{is_followup EQ '1'}">
<MvEVAL EXPR = ProcessFollowup()>
<MvELSE>
<MvASSIGN NAME = "parentnum" VALUE = "{super_root}">
<MvASSIGN NAME = "nest_level" VALUE = "{'1'}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];">
</MvIF>
<MvEVAL EXPR = UpdateSuperRoot()>
<MvEVAL EXPR = CreateDatabaseRecord()>
</MvLOCKFILE>
</MvLOCKFILE>
</MvLOCKFILE>
</MvLOCKFILE>
<MvASSIGN NAME = "foo" VALUE = "{fdelete('&[dirprefix];/lockfile')}">
</MvFUNCTION>
<MvFUNCTION NAME = "ProcessFollowup">
<MvASSIGN NAME = "parentnum" VALUE = "{parm_followup_to}">
<MvCOMMENT> The following will change as we ascend to super_root. </MvCOMMENT>
<MvASSIGN NAME = "temp_parentnum" VALUE = "{parentnum}">
<MvCOMMENT> Find parent quickly via selfnum index. </MvCOMMENT>
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file2];">
<MvFIND NAME = "&[dbname];" VALUE = "{temp_parentnum}" EXACT = "EXACT"></MvFIND>
<MvASSIGN NAME = "nest_level" VALUE = "{dbnestlvl + 1}">
<MvASSIGN NAME = "parent_recno" VALUE = "{&[dbname];.d.recno}">
<MvCLOSE NAME = "&[dbname];">
<MvEVAL EXPR = UpdatePredecessors()>
</MvFUNCTION>
<MvFUNCTION NAME = "UpdatePredecessors">
<MvCOMMENT> Visit the posting immediately after the new posting, and set up
the new posting's sequence number. Then visit each posting from the
new posting's parent back up to the root which is the ancestor of
the new posting. Increment each *ancestor*'s number of descendents,
including the root's. Then travel *forward* from the root to the
parent again, incrementing each posting's sequence number except
for the root's. We have to do the sequence number incrementing in
the forward direction to avoid generating temporarily duplicate
sequence numbers, which would throw off the index.
</MvCOMMENT>
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
<MvEVAL EXPR = AccessFollowingPosting()>
<MvEVAL EXPR = UpdateNumDescendents()>
<MvEVAL EXPR = UpdateSequenceNumbers()>
</MvFUNCTION>
<MvFUNCTION NAME = "AccessFollowingPosting">
<MvGO ROW = parent_recno>
<MvCOMMENT> Read record after insert point. </MvCOMMENT>
<MvSKIP>
<MvCOMMENT> Set up sequence number for new posting. </MvCOMMENT>
<MvIF EXPR = "{NOT &[dbname];.d.eof}">
<MvASSIGN NAME = "seqnum" VALUE = "{dbseqnum + 1}">
<MvELSE>
<MvASSIGN NAME = "seqnum" VALUE = "{'1'}">
</MvIF>
<MvASSIGN NAME = "seqnum" VALUE = "{padl(seqnum,seqnum_size,'0')}">
</MvFUNCTION>
<MvFUNCTION NAME = "UpdateNumDescendents">
<MvGO ROW = parent_recno>
<MvWHILE EXPR = "{dbparentno NE super_root}">
<MvIF EXPR = "{dbselfnum EQ temp_parentnum}">
<MvASSIGN NAME = "dbnumdesc" VALUE = "{dbnumdesc + 1}">
<MvASSIGN NAME = "temp_parentnum" VALUE = "{dbparentno}">
<MvUPDATE NAME = "&[dbname];"></MvUPDATE>
</MvIF>
<MvSKIP ROWS = -1>
</MvWHILE>
<MvCOMMENT> Update root. </MvCOMMENT>
<MvASSIGN NAME = "dbnumdesc" VALUE = "{dbnumdesc + 1}">
<MvUPDATE NAME = "&[dbname];"></MvUPDATE>
</MvFUNCTION>
<MvFUNCTION NAME = "UpdateSequenceNumbers">
<MvCOMMENT> We're at root. </MvCOMMENT>
<MvIF EXPR = "{dbselfnum EQ parentnum}">
<MvFUNCRETURN></MvFUNCRETURN>
</MvIF>
<MvWHILE EXPR = "{dbselfnum NE parentnum}">
<MvSKIP>
<MvASSIGN NAME = "dbseqnum" VALUE = "{dbseqnum + 1}">
<MvASSIGN NAME = "dbseqnum" VALUE = "{padl(dbseqnum,seqnum_size,'0')}">
<MvUPDATE NAME = "&[dbname];"></MvUPDATE>
</MvWHILE>
</MvFUNCTION>
<MvFUNCTION NAME = "UpdateSuperRoot">
<MvGO ROW = 1>
<MvASSIGN NAME = "dbnumdesc" VALUE = "{dbnumdesc + 1}">
<MvASSIGN NAME = "currself" VALUE = "{dbnumdesc + big_bump}">
<MvCOMMENT> If adding a root, assign new root's sequence number, and
update super root's root count and sequence number. </MvCOMMENT>
<MvIF EXPR = "{is_followup NE '1'}">
<MvASSIGN NAME = "seqnum" VALUE = "{dbseqnum}">
<MvASSIGN NAME = "dbparentno" VALUE = "{dbparentno + 1}">
<MvASSIGN NAME = "dbseqnum" VALUE = "{dbseqnum + max_seqnum_increment}">
<MvASSIGN NAME = "dbseqnum" VALUE = "{padl(dbseqnum,seqnum_size,'0')}">
</MvIF>
<MvASSIGN NAME = "last_rootnum" VALUE = "{dbparentno}">
<MvUPDATE NAME = "&[dbname];"></MvUPDATE>
</MvFUNCTION>
<MvFUNCTION NAME = "CreateDatabaseRecord">
<MvCOMMENT> Create database record for the new posting. </MvCOMMENT>
<MvASSIGN NAME = "dbselfnum" VALUE = "{currself}">
<MvASSIGN NAME = "dbparentno" VALUE = "{parentnum}">
<MvASSIGN NAME = "dbnumdesc" VALUE = "{'0'}">
<MvASSIGN NAME = "dbseqnum" VALUE = "{seqnum}">
<MvASSIGN NAME = "dbnestlvl" VALUE = "{nest_level}">
<MvASSIGN NAME = "dbdate" VALUE = "{date}">
<MvASSIGN NAME = "dbtime" VALUE = "{time}">
<MvASSIGN NAME = "dblongdate" VALUE = "{long_date}">
<MvASSIGN NAME = "dbipaddr" VALUE = "{&[REMOTE_ADDR];}">
<MvASSIGN NAME = "dbname1" VALUE = "{name}">
<MvASSIGN NAME = "dbemail" VALUE = "{email}">
<MvASSIGN NAME = "dbsubject" VALUE = "{subject}">
<MvASSIGN NAME = "dblinkurl" VALUE = "{message_url}">
<MvASSIGN NAME = "dblinktitl" VALUE = "{message_url_title}">
<MvASSIGN NAME = "dbimageurl" VALUE = "{message_img}">
<MvADD NAME = "&[dbname];"></MvADD>
<MvCLOSE NAME = "&[dbname];">
</MvFUNCTION>
<MvFUNCTION NAME = "BuildMessageFile">
<MvCOMMENT> Create a file for the message text </MvCOMMENT>
<MvASSIGN NAME = "filename" VALUE = "{dirprefix $ '/' $ mesgdir $ '/' $ currself $ '.' $ ext}">
<MvEXPORT FILE = filename FIELDS = "body" DELIMITER = ""></MvEXPORT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessage">
<MvEVAL EXPR = ShowMessageInit()>
<MvEVAL EXPR = ShowMessageHTML1()>
<MvEVAL EXPR = ShowMessageHTML2()>
<MvEVAL EXPR = ShowMessageHTML3()>
<MvEVAL EXPR = ShowMessageFormIntro()>
<MvEVAL EXPR = ShowMessageFormSubject()>
<MvEVAL EXPR = ShowMessageFormComments()>
<MvEVAL EXPR = ShowMessageWrapup()>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageInit">
<MvASSIGN NAME = "filename" VALUE = "{dirprefix $ '/' $ mesgdir $ '/' $ parm_msgnum $ '.' $ ext}">
<MvIMPORT FILE = filename FIELDS = "body" DELIMITER = "">
</MvIMPORT>
<MvCOMMENT> Get hidden field data from database. </MvCOMMENT>
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file2];,&[index_file1];,&[index_file3];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
<MvFIND NAME = "&[dbname];" VALUE = "{parm_msgnum}" EXACT = "EXACT"></MvFIND>
<MvASSIGN NAME = "parent" VALUE = "{dbparentno}">
<MvASSIGN NAME = "name" VALUE = "{dbname1}">
<MvASSIGN NAME = "email" VALUE = "{dbemail}">
<MvASSIGN NAME = "subject" VALUE = "{dbsubject}">
<MvASSIGN NAME = "date" VALUE = "{dbdate}">
<MvASSIGN NAME = "time" VALUE = "{dbtime}">
<MvASSIGN NAME = "longdate" VALUE = "{dblongdate}">
<MvASSIGN NAME = "ipaddr" VALUE = "{dbipaddr}">
<MvASSIGN NAME = "url" VALUE = "{dblinkurl}">
<MvASSIGN NAME = "url_title" VALUE = "{dblinktitl}">
<MvASSIGN NAME = "img" VALUE = "{dbimageurl}">
<MvASSIGN NAME = "starting_recno" VALUE = "{&[dbname];.d.recno}">
<MvASSIGN NAME = "starting_nestlvl" VALUE = "{dbnestlvl}">
<MvIF EXPR = "{parent NE super_root}">
<MvFIND NAME = "&[dbname];" VALUE = "{parent}" EXACT = "EXACT"></MvFIND>
<MvASSIGN NAME = "parent_name" VALUE = "{dbname1}">
<MvASSIGN NAME = "parent_subject" VALUE = "{dbsubject}">
<MvASSIGN NAME = "parent_date" VALUE = "{dbdate}">
<MvASSIGN NAME = "parent_time" VALUE = "{dbtime}">
<MvASSIGN NAME = "parent_ipaddr" VALUE = "{dbipaddr}">
</MvIF>
<MvCLOSE NAME = "&[dbname];">
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageHTML1">
&[ON];&[header];<center><h1>&[subject];</h1></center>&[crlf];&[OFF];
<MvASSIGN NAME = "showing_message" VALUE = "{1}">
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
<MvASSIGN NAME = "showing_message" VALUE = "{0}">
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageHTML2">
&[ON];<BLOCKQUOTE>Posted by&[crlf];&[OFF];
<MvIF EXPR = "{use_time EQ 'on'}">
<MvASSIGN NAME = "print_date" VALUE = "{time $ ' ' $ date}">
<MvASSIGN NAME = "parent_print_date" VALUE = "{parent_time $ ' ' $ parent_date}">
<MvELSE>
<MvASSIGN NAME = "print_date" VALUE = "{date}">
<MvASSIGN NAME = "parent_print_date" VALUE = "{parent_date}">
</MvIF>
<MvIF EXPR = "{email NE ''}">
&[ON];<a href="mailto:&[email];">&[name];</a> on &[print_date]; from &[ipaddr];:<p>&[crlf];&[OFF];
<MvELSE>
&[ON];&[name]; on &[print_date]; from &[ipaddr];:<p>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{parent NE super_root}">
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
<MvASSIGN NAME = "parent_msg" VALUE = "{'&[documenturl];parm_func=showmsg+parm_msgnum=&[parent];+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];'}">
<MvELSE>
<MvASSIGN NAME = "parent_msg" VALUE = "{'&[documenturl];parm_func=showmsg+parm_msgnum=&[parent];'}">
</MvIF>
&[ON];In reply to: <a href="&[parent_msg];">&[parent_subject];</a> posted by &[crlf];&[OFF];
<MvIF EXPR = "{parent_email NE ''}">
&[ON];<a href="&[parent_email];">&[parent_name];</a> on &[parent_print_date];:<p>&[crlf];&[OFF];
<MvELSE>
&[ON];&[parent_name]; on &[parent_print_date]; from &[parent_ipaddr];:<p>&[crlf];&[OFF];
</MvIF>
</MvIF>
<MvIF EXPR = "{allow_gif EQ 'on' AND img NE ''}">
&[ON];<center><img src="&[img];"></center><p>&[crlf];&[OFF];
</MvIF>
&[ON];&[body];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageHTML3">
<MvIF EXPR = "{url NE ''}">
&[ON];<ul><li><a href="&[url];">&[url_title];</a></ul>&[crlf];&[OFF];
</MvIF>
&[ON];</BLOCKQUOTE><hr width=90%><p>&[crlf];&[OFF];
&[ON];<a NAME = followups><UL><H3>Follow Ups:</H3></UL>&[crlf];&[OFF];
<MvASSIGN NAME = "roots_per_page" VALUE = "{'1'}">
<MvASSIGN NAME = "roots_displayed_count" VALUE = "{'0'}">
<MvASSIGN NAME = "traverse_function" VALUE = "{'AddLine'}">
<MvASSIGN NAME = "traverse_reason" VALUE = "{'followups'}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
&[ON]<BLOCKQUOTE>&[OFF]
<MvEVAL EXPR = TraverseTree(parm_admin_flag,parm_user,parm_pass)>
<MvEVAL EXPR = Unindent()>
<MvCLOSE NAME = "&[dbname];">
&[ON];<hr width=90%><p>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageFormIntro">
&[ON];<a NAME = postfollowup><UL><center><H1>Post a Followup</H1></center></UL>&[crlf];&[OFF];
<MvIF EXPR = "{show_preview EQ 'on'}">
<MvASSIGN NAME = "postvar" VALUE = "{'parm_func=followuppreview'}">
<MvELSE>
<MvASSIGN NAME = "postvar" VALUE = "{'parm_func=post'}">
</MvIF>
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];<form method=POST action="&[documenturl];&[postvar];+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
<MvELSE>
&[ON];<form method=POST action="&[documenturl];&[postvar];">&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{allow_html_subj EQ 'on'}">
<MvASSIGN NAME = "subject" VALUE = "{ConvertTags(subject)}">
</MvIF>
&[ON];<input type=hidden name="parm_followup_to" value="&[parm_msgnum];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origname" value="&[name];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origemail" value="&[email];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origsubject" value="&[subject];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origdate" value="&[longdate];"></INPUT>&[crlf];&[OFF];
&[ON];<CENTER><TABLE>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Name:</TH><TD><input type=text name="form_name" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
&[ON];<TR><TH align="left">E-Mail:</TH><TD><input type=text name="form_email" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageFormSubject">
<MvIF EXPR = "{subject_line EQ '0'}">
<MvASSIGN NAME = "a1" VALUE = "{'Re:' IN subject}">
<MvIF EXPR = "{a1 EQ '1'}">
&[ON];<TR><TH align="left">Subject:</TH><TD><b>&[crlf];&[OFF];
&[ON];<input type=text name="form_subject" size=&[textwidth]; maxlength=&[textwidth]; value="&[subject];"></INPUT></b></TD></TR>&[crlf];&[OFF];
<MvELSE>
&[ON];<TR><TH align="left">Subject:</TH><TD><b>&[crlf];&[OFF];
&[ON];<input type=text name="form_subject" size=&[textwidth]; maxlength=&[textwidth]; value="Re: &[subject];"></INPUT></b></TD></TR>&[crlf];&[OFF];
</MvIF>
<MvELSE>
<MvIF EXPR = "{subject_line EQ '1'}">
<MvASSIGN NAME = "a1" VALUE = "{'Re:' IN subject}">
<MvIF EXPR = "{a1 EQ '1'}">
&[ON];<input type=hidden name="form_subject" size=&[textwidth]; maxlength=&[textwidth]; value="&[subject];"></INPUT>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Subject:</TH><TD><b>&[subject];</b></TD></TR>&[crlf];&[OFF];
<MvELSE>
&[ON];<input type=hidden name="form_subject" size=&[textwidth]; maxlength=&[textwidth]; value="Re: &[subject];"></INPUT>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Subject:</TH><TD><b>Re: &[subject];</b></TD></TR>&[crlf];&[OFF];
</MvIF>
<MvELSE>
<MvIF EXPR = "{subject_line EQ '2'}">
&[ON];<TR><TH align="left">Subject:</TH><TD><input type=text name="form_subject" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
<MvELSE>
<MvASSIGN NAME = "a1" VALUE = "{'Re:' IN subject}">
<MvIF EXPR = "{a1 EQ '1'}">
&[ON];<TR><TH align="left">Subject:</TH><TD><input type=text name="form_subject" value="&[subject];" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
<MvELSE>
&[ON];<TR><TH align="left">Subject:</TH><TD><input type=text name="form_subject" value="Re: &[subject];" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvIF EXPR = "{allow_html_subj EQ 'on'}">
<MvASSIGN NAME = "subject" VALUE = "{ReconvertTags(subject)}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageFormComments">
&[ON];<TR><TH align="left">Comments:</TH><TD>&[crlf];&[OFF];
<MvCOMMENT> If requested, add lines of the message to the reply comment area, preceded by colons.
Produce one line until a <br>, newline, or <p> tag is seen. If it's a <p>, also produce
a blank line.
Before processing body text to be quoted, convert any longforms of characters (i.e. < for
<, > for >, and " for ") to shortform, then reconvert when ready to display.
</MvCOMMENT>
<MvIF EXPR = "{quote_text EQ 'on'}">
<MvIF EXPR = "{allow_html_body NE 'on'}">
<MvASSIGN NAME = "body" VALUE = "{ReconvertTags(body)}">
</MvIF>
<MvASSIGN NAME = "curr_pos" VALUE = "{'1'}">
<MvASSIGN NAME = "lenny" VALUE = "{len(body)}">
<MvASSIGN NAME = "a3" VALUE = "{crlf CIN body}">
<MvIF EXPR = "{lenny GT 1 AND a3 EQ lenny - 1}">
<MvASSIGN NAME = "lenny" VALUE = "{lenny - 2}">
</MvIF>
<MvASSIGN NAME = "out_body" VALUE = "{''}">
<MvWHILE EXPR = "{curr_pos LE lenny}">
<MvASSIGN NAME = "a1" VALUE = "{'<p>' CIN substring(body,curr_pos,lenny-curr_pos+1)}">
<MvASSIGN NAME = "a2" VALUE = "{'<br>' CIN substring(body,curr_pos,lenny-curr_pos+1)}">
<MvASSIGN NAME = "a3" VALUE = "{crlf CIN substring(body,curr_pos,lenny-curr_pos+1)}">
<MvIF EXPR = "{a1 GT '0'}">
<MvIF EXPR = "{((a2 EQ 0) OR (a2 GT a1)) AND ((a3 EQ 0) OR (a3 GT a1))}">
<MvIF EXPR = "{a1 GT textwidth - 2}"> <MvCOMMENT> Too big to fit with : </MvCOMMENT>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,textwidth - 2)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + textwidth - 2}">
<MvELSE>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,a1-1)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a1-1 + 3}">
</MvIF>
<MvELSE>
<MvIF EXPR = "{((a2 NE 0) AND (a2 LT a1)) AND ((a3 EQ 0) OR (a3 GT a2))}">
<MvIF EXPR = "{a2 GT textwidth - 2}"> <MvCOMMENT> Too big to fit with : </MvCOMMENT>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,textwidth - 2)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + textwidth - 2}">
<MvELSE>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,a2-1)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a2-1 + 4}">
</MvIF>
<MvELSE>
<MvIF EXPR = "{(a3 GT 0) AND (a3 LT a1)}">
<MvIF EXPR = "{a3 GT textwidth - 2}"> <MvCOMMENT> Too big to fit with : </MvCOMMENT>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,textwidth - 2)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + textwidth - 2}">
<MvELSE>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,a3-1)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a3-1 + 2}">
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvELSE>
<MvIF EXPR = "{(a2 GT 0) AND ((a3 EQ 0) OR (a3 GT a2))}">
<MvIF EXPR = "{a2 GT textwidth - 2}"> <MvCOMMENT> Too big to fit with : </MvCOMMENT>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,textwidth - 2)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + textwidth - 2}">
<MvELSE>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,a2-1)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a2-1 + 4}">
</MvIF>
<MvELSE>
<MvIF EXPR = "{a3 GT '0'}">
<MvIF EXPR = "{a3 GT textwidth - 2}"> <MvCOMMENT> Too big to fit with : </MvCOMMENT>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,textwidth - 2)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + textwidth - 2}">
<MvELSE>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,a3-1)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + a3-1 + 2}">
</MvIF>
<MvELSE>
<MvIF EXPR = "{(lenny - curr_pos + 1) GT textwidth - 2}"><MvCOMMENT> Too big to fit with : </MvCOMMENT>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,textwidth - 2)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{curr_pos + textwidth - 2}">
<MvELSE>
<MvASSIGN NAME = "a4" VALUE = "{substring(body,curr_pos,lenny-curr_pos+1)}">
<MvASSIGN NAME = "out_body" VALUE = "{out_body $ ': ' $ a4 $ crlf}">
<MvASSIGN NAME = "curr_pos" VALUE = "{lenny + 1}">
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvWHILE>
</MvIF>
<MvIF EXPR = "{allow_html_body NE 'on'}">
<MvASSIGN NAME = "out_body" VALUE = "{ConvertTags(out_body)}">
</MvIF>
&[ON];<textarea name="form_body" wrap="virtual" COLS=&[textwidth]; ROWS=10>&[out_body];</textarea></TD></TR>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowMessageWrapup">
&[ON];<p>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Optional Link URL:</TH><TD><input type=text name="form_url" size=&[textwidth]; maxlength=&[urlwidth];></INPUT></TD></TR>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Link Title:</TH><TD><input type=text name="form_url_title" size=&[textwidth]; maxlength=&[urlwidth];></INPUT></TD></TR>&[crlf];&[OFF];
<MvIF EXPR = "{allow_gif EQ 'on'}">
&[ON];<TR><TH align="left">Optional Image URL:</TH><TD><input type=text name="form_img" size=&[textwidth]; maxlength=&[urlwidth];></INPUT></TD></TR>&[crlf];&[OFF];
</MvIF>
&[ON];</TABLE>&[crlf];&[OFF];
&[ON];<br><input type=submit value="Submit Follow Up"></INPUT> <input type=reset></INPUT>&[crlf];&[OFF];
&[ON];</CENTER></p>&[crlf];&[OFF];
&[ON];</form>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
<MvASSIGN NAME = "showing_message" VALUE = "{1}">
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
<MvASSIGN NAME = "showing_message" VALUE = "{0}">
&[ON];</center></p>&[banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowPostPreview">
<MvEVAL EXPR = ConvertPreviewInput()>
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Message Verify: &[subject];</h1></center>&[crlf];&[OFF];
&[ON];<ul>Please verify this posting content before it is posted.</ul><hr width=90%><ul>&[crlf];&[OFF];
&[ON];<b>Name:</b> &[name];<BR>&[crlf];&[OFF];
&[ON];<b>E-Mail:</b> &[email];<BR>&[crlf];&[OFF];
&[ON];<b>Subject:</b> &[subject];<BR>&[crlf];&[OFF];
&[ON];<b>Body of Message:</b><p>&[crlf];&[OFF];
<MvASSIGN NAME = "body" VALUE = "{glosub(body,crlf,'<br>')}">
<MvASSIGN NAME = "body" VALUE = "{glosub(body,'<p>','<br>')}">
&[ON];&[body];<p>&[crlf];&[OFF];
<MvIF EXPR = "{url NE ''}">
&[ON];<b>Link URL:</b> &[url];<br>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{url_title NE ''}">
&[ON];<b>Link Title:</b> &[url_title];<br>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{img NE ''}">
&[ON];<b>Image URL:</b> &[img];&[crlf];<br>&[OFF];
</MvIF>
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];<form action="&[documenturl];parm_func=post+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];" method="POST">&[crlf];&[OFF];
<MvELSE>
&[ON];<form action="&[documenturl];parm_func=post" method="POST">&[crlf];&[OFF];
</MvIF>
&[ON];</ul><p>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_name" value="&[name];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_email" value="&[email];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_subject" value="&[subject];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_body" value="&[body];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_url" value="&[url];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_url_title" value="&[url_title];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_img" value="&[img];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origsubject" value="&[origsubject];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origname" value="&[origname];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origemail" value="&[origemail];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origdate" value="&[origdate];">&[crlf];&[OFF];
&[ON];<hr width=90%>&[crlf];&[OFF];
&[ON];<p><center><font size=+1><b>Use Your Browser's [Back]; Button To Make Changes</b></font></center>&[crlf];&[OFF];
&[ON];<p><center><input type=submit value="Post Message"></center>&[crlf];&[OFF];
&[ON];<p><center></center>&[crlf];&[OFF];
&[ON];<hr width=90%>&[banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowFollowupPreview">
<MvEVAL EXPR = ConvertPreviewInput()>
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Message Verify: &[subject];</h1></center>&[crlf];&[OFF];
&[ON];<ul>Please verify this followup content before it is posted.</ul><hr width=90%><ul>&[crlf];&[OFF];
&[ON];<b>Name:</b> &[name];<BR>&[crlf];&[OFF];
&[ON];<b>E-Mail:</b> &[email];<BR>&[crlf];&[OFF];
&[ON];<b>Subject:</b> &[subject];<BR>&[crlf];&[OFF];
&[ON];<b>Body of Message:</b><p>&[crlf];&[OFF];
<MvASSIGN NAME = "body" VALUE = "{glosub(body,crlf,'<br>')}">
<MvASSIGN NAME = "body" VALUE = "{glosub(body,'<p>','<br>')}">
&[ON];&[body];<p>&[crlf];&[OFF];
<MvIF EXPR = "{url NE ''}">
&[ON];<b>Link URL:</b> &[url];<br>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{url_title NE ''}">
&[ON];<b>Link Title:</b> &[url_title];<br>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{img NE ''}">
&[ON];<b>Image URL:</b> &[img];<br>&[crlf];&[OFF];
</MvIF>
&[ON];</ul><p>&[crlf];&[OFF];
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];<form action="&[documenturl];parm_func=post+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];" method="POST">&[crlf];&[OFF];
<MvELSE>
&[ON];<form action="&[documenturl];parm_func=post" method="POST">&[crlf];&[OFF];
</MvIF>
&[ON];<input type=hidden name="parm_followup_to" value="&[parm_followup_to];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_name" value="&[name];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_email" value="&[email];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_subject" value="&[subject];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_body" value="&[body];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_url" value="&[url];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_url_title" value="&[url_title];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_img" value="&[img];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origsubject" value="&[origsubject];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origname" value="&[origname];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origemail" value="&[origemail];">&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origdate" value="&[origdate];">&[crlf];&[OFF];
&[ON];<hr width=90%>&[crlf];&[OFF];
&[ON];<p><center><font size=+1><b>Use Your Browser's [Back]; Button To Make Changes</b></font></center>&[crlf];&[OFF];
&[ON];<p><center><input type=submit value="Post Followup"></center>&[crlf];&[OFF];
&[ON];<p><center></center>&[crlf];&[OFF];
&[ON];<hr width=90%>&[banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ConvertPreviewInput">
<MvASSIGN name="name" value="{ConvertTags(form_name)}">
<MvASSIGN name="email" value="{ConvertTags(form_email)}">
<MvASSIGN name="subject" value="{ConvertTags(form_subject)}">
<MvASSIGN name="body" value="{ConvertTags(form_body)}">
<MvASSIGN name="url" value="{ConvertTags(form_url)}">
<MvASSIGN name="url_title" value="{ConvertTags(form_url_title)}">
<MvASSIGN name="img" value="{ConvertTags(form_img)}">
<MvASSIGN name="origsubject" value="{ConvertTags(form_origsubject)}">
<MvASSIGN name="origname" value="{ConvertTags(form_origname)}">
<MvASSIGN name="origemail" value="{ConvertTags(form_origemail)}">
<MvASSIGN name="origdate" value="{ConvertTags(form_origdate)}">
<MvCOMMENT> bread crumb...macros choke on tags in their data, thus convert and reconvert
without macroing the raw data. </MvCOMMENT>
<MvCOMMENT>
<MvIF EXPR = "{allow_html_subj EQ 'on'}">
<MvASSIGN name="subject" value="{ReconvertTags(subject)}">
</MvIF>
<MvIF EXPR = "{allow_html_body EQ 'on'}">
<MvASSIGN name="body" value="{ReconvertTags(body)}">
</MvIF>
</MvCOMMENT>
<MvASSIGN NAME = "body" VALUE = "{glosub(body,crlf,'<p>')}">
</MvFUNCTION>
<MvFUNCTION NAME = "ShowPostForm">
<MvEVAL EXPR = ShowPostFormIntro()>
&[ON];<div align="center"><center><table border="0">&[crlf];&[OFF];
&[ON];<tr><th align="left">Name:</th>&[crlf];&[OFF];
&[ON];<td><input type="text" size=&[textwidth]; maxlength=&[textwidth]; name="form_name"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><th align="left">E-Mail:</th>&[crlf];&[OFF];
&[ON];<td><input type="text" size=&[textwidth]; maxlength=&[textwidth]; name="form_email"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><th align="left">Subject:</th>&[crlf];&[OFF];
&[ON];<td><input type="text" size=&[textwidth]; maxlength=&[textwidth]; name="form_subject"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><th align="left">Message:</th>&[crlf];&[OFF];
&[ON];<td><textarea name="form_body" wrap="virtual" rows="10" cols=&[textwidth];></textarea></td></tr>&[crlf];&[OFF];
&[ON];<tr><th align="left">Optional Link URL:</th>&[crlf];&[OFF];
<MvCOMMENT> Allow URL's to be up to db field size, tho input box only looks 60 wide. </MvCOMMENT>
&[ON];<td><input type="text" size=&[textwidth]; maxlength=&[urlwidth]; name="form_url"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><th align="left">Link Title:</th>&[crlf];&[OFF];
&[ON];<td><input type="text" size=&[textwidth]; maxlength=&[urlwidth]; name="form_url_title"></INPUT></td></tr>&[crlf];&[OFF];
<MvIF EXPR = "{allow_gif EQ 'on'}">
&[ON];<tr><th align="left">Optional Image URL:</th>&[crlf];&[OFF];
&[ON];<td><input type="text" size=&[textwidth]; maxlength=&[urlwidth]; name="form_img"></INPUT></td></tr>&[crlf];&[OFF];
</MvIF>
&[ON];</table>&[crlf];&[OFF];
&[ON];<br>&[crlf];&[OFF];
&[ON];<input type="submit" value="Post Message"></INPUT> <input type="reset"></INPUT>&[crlf];&[OFF];
&[ON];</center></div></form>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];&[banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowPostFormIntro">
<MvEVAL EXPR = SeeIfBlocked()>
<MvIF EXPR = "{blocked_ip EQ '1'}">
<MvEVAL EXPR = Error("blocked_ip")>
<MvFUNCRETURN></MvFUNCRETURN>
</MvIF>
&[ON];&[header];<h1 align="center">Post A Message!</h1>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
<MvIF EXPR = "{show_preview EQ 'on'}">
<MvASSIGN NAME = "postvar" VALUE = "{'parm_func=postpreview'}">
<MvELSE>
<MvASSIGN NAME = "postvar" VALUE = "{'parm_func=post'}">
</MvIF>
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];<form action="&[documenturl];&[postvar];+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];" method="POST">&[crlf];&[OFF];
<MvELSE>
&[ON];<form action="&[documenturl];&[postvar];" method="POST">&[crlf];&[OFF];
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowSearchForm">
<MvEVAL EXPR = ShowSearchFormIntro()>
<MvEVAL EXPR = ShowSearchFormStartdate()>
<MvEVAL EXPR = ShowSearchFormEnddate()>
<MvEVAL EXPR = ShowSearchFormWrapup()>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowSearchFormIntro">
&[ON];<html><head>&[crlf];&[OFF];
&[ON];<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">&[crlf];&[OFF];
&[ON];<title>&[title]; Search</title></head>&[crlf];&[OFF];
&[ON];&[header];&[crlf];&[OFF];
&[ON];<h1 align="center">&[title]; Search</h1>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];<form method=POST action="&[documenturl];parm_func=showmain+parm_starting_root=&[parm_starting_root];+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
<MvELSE>
&[ON];<form method=POST action="&[documenturl];parm_func=showmain+parm_starting_root=&[parm_starting_root];">&[crlf];&[OFF];
</MvIF>
&[ON];<center>&[crlf];&[OFF];
&[ON];Choose the type(s) of information to search by. One or more may be selected.<br><br>&[crlf];&[OFF];
&[ON];<table>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align = "left">Search subject?</th>&[crlf];&[OFF];
&[ON];<td><input type = "checkbox" name = "use_searchstring"></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align = "left">Use start date?</th>&[crlf];&[OFF];
&[ON];<td><input type = "checkbox" name = "use_startdate"></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align = "left">Use end date?</th>&[crlf];&[OFF];
&[ON];<td><input type = "checkbox" name = "use_enddate"></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];</table>&[crlf];&[OFF];
&[ON];<br>&[crlf];&[OFF];
&[ON];<table>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align = "left">Find subject containing:</th>&[crlf];&[OFF];
&[ON];<td><input type = "text" name = "search_string">&[crlf];&[OFF];
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowSearchFormStartdate">
<MvASSIGN NAME = "sm" VALUE = "{time_t_month(time_t,time_zone)}">
<MvASSIGN NAME = "sm&[sm];" VALUE = "{'selected'}">
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align = "left">Start date:</th>&[crlf];&[OFF];
&[ON];<td>&[crlf];&[OFF];
&[ON];<select name = "start_month">&[crlf];&[OFF];
&[ON];<option value = "01" &[sm1];>January&[crlf];&[OFF];
&[ON];<option value = "02" &[sm2];>February&[crlf];&[OFF];
&[ON];<option value = "03" &[sm3];>March&[crlf];&[OFF];
&[ON];<option value = "04" &[sm4];>April&[crlf];&[OFF];
&[ON];<option value = "05" &[sm5];>May&[crlf];&[OFF];
&[ON];<option value = "06" &[sm6];>June&[crlf];&[OFF];
&[ON];<option value = "07" &[sm7];>July&[crlf];&[OFF];
&[ON];<option value = "08" &[sm8];>August&[crlf];&[OFF];
&[ON];<option value = "09" &[sm9];>September&[crlf];&[OFF];
&[ON];<option value = "10" &[sm10];>October&[crlf];&[OFF];
&[ON];<option value = "11" &[sm11];>November&[crlf];&[OFF];
&[ON];<option value = "12" &[sm12];>December&[crlf];&[OFF];
&[ON];</select>&[crlf];&[OFF];
<MvASSIGN NAME = "sd" VALUE = "{time_t_dayofmonth(time_t,time_zone)}">
<MvASSIGN NAME = "sd&[sd];" VALUE = "{'selected'}">
&[ON];<select name = "start_day">&[crlf];&[OFF];
&[ON];<option &[sd1];>01<option &[sd2];>02<option &[sd3];>03<option &[sd4];>04<option &[sd5];>05&[crlf];&[OFF];
&[ON];<option &[sd6];>06<option &[sd7];>07<option &[sd8];>08<option &[sd9];>09<option &[sd10];>10&[crlf];&[OFF];
&[ON];<option &[sd11];>11<option &[sd12];>12<option &[sd13];>13<option &[sd14];>14<option &[sd15];>15&[crlf];&[OFF];
&[ON];<option &[sd16];>16<option &[sd17];>17<option &[sd18];>18<option &[sd19];>19<option &[sd20];>20&[crlf];&[OFF];
&[ON];<option &[sd21];>21<option &[sd22];>22<option &[sd23];>23<option &[sd24];>24<option &[sd25];>25&[crlf];&[OFF];
&[ON];<option &[sd26];>26<option &[sd27];>27<option &[sd28];>28<option &[sd29];>29<option &[sd30];>30&[crlf];&[OFF];
&[ON];<option &[sd31];>31&[crlf];&[OFF];
&[ON];</select>&[crlf];&[OFF];
<MvASSIGN NAME = "sy" VALUE = "{time_t_year(time_t,time_zone)}">
<MvASSIGN NAME = "sy&[sy];" VALUE = "{'selected'}">
&[ON];<select name = "start_year">&[crlf];&[OFF];
&[ON];<option &[sy1998];>1998<option &[sy1999];>1999<option &[sy2000];>2000<option &[sy2001];>2001&[crlf];&[OFF];
&[ON];<option &[sy2002];>2002<option &[sy2003];>2003<option &[sy2004];>2004&[crlf];&[OFF];
&[ON];</select>&[crlf];&[OFF];
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowSearchFormEnddate">
<MvASSIGN NAME = "em" VALUE = "{time_t_month(time_t,time_zone)}">
<MvASSIGN NAME = "em&[em];" VALUE = "{'selected'}">
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align = "left">End date:</th>&[crlf];&[OFF];
&[ON];<td>&[crlf];&[OFF];
&[ON];<select name = "end_month">&[crlf];&[OFF];
&[ON];<option value = "01" &[em1];>January&[crlf];&[OFF];
&[ON];<option value = "02" &[em2];>February&[crlf];&[OFF];
&[ON];<option value = "03" &[em3];>March&[crlf];&[OFF];
&[ON];<option value = "04" &[em4];>April&[crlf];&[OFF];
&[ON];<option value = "05" &[em5];>May&[crlf];&[OFF];
&[ON];<option value = "06" &[em6];>June&[crlf];&[OFF];
&[ON];<option value = "07" &[em7];>July&[crlf];&[OFF];
&[ON];<option value = "08" &[em8];>August&[crlf];&[OFF];
&[ON];<option value = "09" &[em9];>September&[crlf];&[OFF];
&[ON];<option value = "10" &[em10];>October&[crlf];&[OFF];
&[ON];<option value = "11" &[em11];>November&[crlf];&[OFF];
&[ON];<option value = "12" &[em12];>December&[crlf];&[OFF];
&[ON];</select>&[crlf];&[OFF];
<MvASSIGN NAME = "ed" VALUE = "{time_t_dayofmonth(time_t,time_zone)}">
<MvASSIGN NAME = "ed&[ed];" VALUE = "{'selected'}">
&[ON];<select name = "end_day">&[crlf];&[OFF];
&[ON];<option &[ed1];>01<option &[ed2];>02<option &[ed3];>03<option &[ed4];>04<option &[ed5];>05&[crlf];&[OFF];
&[ON];<option &[ed6];>06<option &[ed7];>07<option &[ed8];>08<option &[ed9];>09<option &[ed10];>10&[crlf];&[OFF];
&[ON];<option &[ed11];>11<option &[ed12];>12<option &[ed13];>13<option &[ed14];>14<option &[ed15];>15&[crlf];&[OFF];
&[ON];<option &[ed16];>16<option &[ed17];>17<option &[ed18];>18<option &[ed19];>19<option &[ed20];>20&[crlf];&[OFF];
&[ON];<option &[ed21];>21<option &[ed22];>22<option &[ed23];>23<option &[ed24];>24<option &[ed25];>25&[crlf];&[OFF];
&[ON];<option &[ed26];>26<option &[ed27];>27<option &[ed28];>28<option &[ed29];>29<option &[ed30];>30&[crlf];&[OFF];
&[ON];<option &[ed31];>31&[crlf];&[OFF];
&[ON];</select>&[crlf];&[OFF];
<MvASSIGN NAME = "ey" VALUE = "{time_t_year(time_t,time_zone)}">
<MvASSIGN NAME = "ey&[ey];" VALUE = "{'selected'}">
&[ON];<select name = "end_year">&[crlf];&[OFF];
&[ON];<option &[ey1998];>1998<option &[ey1999];>1999<option &[ey2000];>2000<option &[ey2001];>2001&[crlf];&[OFF];
&[ON];<option &[ey2002];>2002<option &[ey2003];>2003<option &[ey2004];>2004&[crlf];&[OFF];
&[ON];</select>&[crlf];&[OFF];
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowSearchFormWrapup">
&[ON];</table>&[crlf];&[OFF];
&[ON];</center>&[crlf];&[OFF];
&[ON];<br><br>&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
&[ON];<input type = "submit" name = "dosearch" value = "Do Search">&[crlf];&[OFF];
&[ON];<input type = "reset" name = "reset" value = "Reset">&[crlf];&[OFF];
&[ON];</center>&[crlf];&[OFF];
&[ON];<br><br>&[crlf];&[OFF];
<MvIF EXPR = "{search_input_error EQ '1'}">
&[ON];<center><font color = "#ff0000" size = "+1">No search criteria were specified.</font></center>&[crlf];&[OFF];
<MvELSE>
<MvIF EXPR = "{search_input_error EQ '2'}">
&[ON];<center><font color = "#ff0000" size = "+1">Invalid search criteria were specified.</font></center>&[crlf];&[OFF];
</MvIF>
</MvIF>
&[ON];</form>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];&[banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowFAQ">
<MvEVAL EXPR = ShowFaqIntro()>
<MvEVAL EXPR = ShowFaq1()>
<MvEVAL EXPR = ShowFaq2()>
<MvEVAL EXPR = ShowFaq3()>
<MvEVAL EXPR = ShowFaq4()>
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];&[banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowFaqIntro">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<h1 align=center>Frequently Asked Questions</h1>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];<ul>Here is a brief explanation of some of the questions you may&[crlf];&[OFF];
&[ON];have about the &[title];.</ul>&[crlf];&[OFF];
&[ON];<hr width="90%">&[crlf];&[OFF];
&[ON];<ul><ul>&[crlf];&[OFF];
&[ON];<li><a href="#links">Can I use html tags anywhere in my&[crlf];&[OFF];
&[ON];posts?</a> </li>&[crlf];&[OFF];
&[ON];<li><a href="#colons">Why are there colons in the message&[crlf];&[OFF];
&[ON];section when I try post a followup?</a> </li>&[crlf];&[OFF];
&[ON];<li><a href="#reload">Why didn't my post show up?</a> </li>&[crlf];&[OFF];
&[ON];<li><a href="#getit">Where can I get the script for this&[crlf];&[OFF];
&[ON];program?</a> </li>&[crlf];&[OFF];
&[ON];</ul></ul>&[crlf];&[OFF];
&[ON];<hr width="90%">&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowFaq1">
&[ON];<BLOCKQUOTE><b><a name="links">Can I use html tags anywhere in my posts?</a></b></BLOCKQUOTE>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE>No. You can not use HTML tags in any field except the subject or body of&[crlf];&[OFF];
&[ON];the message. The maintainer of the script has the option of&[crlf];&[OFF];
&[ON];allowing or disallowing any HTML in these two parts of your&[crlf];&[OFF];
&[ON];posting. If they disallow it, the script will just display the tags but&[crlf];&[OFF];
&[ON];not "execute" them. If they allow it, your html markup will&[crlf];&[OFF];
&[ON];appear in the posting and actually be used.</BLOCKQUOTE>&[crlf];&[OFF];
&[ON];<hr width="90%">&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowFaq2">
&[ON];<BLOCKQUOTE><b><a name="colons">Why are there colons in the message when I&[crlf];&[OFF];
&[ON];try to post a followup?</a></b></BLOCKQUOTE>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE>Colons appear in the message dialog box when you try to&[crlf];&[OFF];
&[ON];followup up on a message to indicate that those lines are quoting&[crlf];&[OFF];
&[ON];the previous document. The owner of the &[title]; can decide&[crlf];&[OFF];
&[ON];whether they wish to enable or disable the quoting of previous&[crlf];&[OFF];
&[ON];messages.</BLOCKQUOTE>&[crlf];&[OFF];
&[ON];<hr width="90%">&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowFaq3">
&[ON];<BLOCKQUOTE><b><a name="reload">Why didn't my post show up?</a></b></BLOCKQUOTE>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE>Your post most likely did not show up because your browser&[crlf];&[OFF];
&[ON];did not reload the page, it simply pulled it out of cache. Please&[crlf];&[OFF];
&[ON];reload your browser and it should then appear.</BLOCKQUOTE>&[crlf];&[OFF];
&[ON];<hr width="90%">&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowFaq4">
&[ON];<BLOCKQUOTE><b><a name="getit">Where can I get the script for this program?</a></b></BLOCKQUOTE>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE>The script is written in Miva and was created by Yahoo!.&[crlf];&[OFF];
&[ON];Enjoy!</BLOCKQUOTE>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ReturnHtml">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Message Added: &[subject];</h1></center>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];<UL>The following information was added to the &[title];:<p></p></UL><p>&[crlf];&[OFF];
&[ON];<UL><b>Name:</b> &[name];<br>&[crlf];&[OFF];
&[ON];<b> E-Mail:</b> &[email];<br>&[crlf];&[OFF];
&[ON];<b> Subject:</b> &[subject];<br>&[crlf];&[OFF];
&[ON];<b> Body of Message:</b></p><p></p>&[crlf];&[OFF];
&[ON];&[body];<p></p>&[crlf];&[OFF];
<MvIF EXPR = "{message_url NE ''}">
&[ON];<b>Link:</b> <a href="&[message_url];">&[message_url_title];</a><br>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{message_img NE ''}">
&[ON];<b>Image:</b> <img src="&[message_img];"><br>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{use_time EQ 'on'}">
<MvASSIGN NAME = "print_date" VALUE = "{time $ ' ' $ date}">
<MvELSE>
<MvASSIGN NAME = "print_date" VALUE = "{date}">
</MvIF>
&[ON];<b>Added on Date:</b> &[print_date];<p></p></UL>&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];[ <a href = "&[documenturl];parm_func=showmsg+parm_msgnum=&[currself];+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
<MvELSE>
&[ON];[ <a href = "&[documenturl];parm_func=showmsg+parm_msgnum=&[currself];">&[crlf];&[OFF];
</MvIF>
&[ON];Go to Your Message</a> ]</center>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];&[banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "Error" PARAMETERS = "error_type">
<MvIF EXPR = "{error_type EQ 'no_name'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>ERROR: No Name</h1></center>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE><center><h3><font color="#ff0000">You forgot to fill in the 'Name' field in your posting.&[crlf];&[OFF];
&[ON];Correct it below and re-submit. The necessary fields are: Name, Subject, and Message.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p></BLOCKQUOTE>&[crlf];&[OFF];
<MvEVAL EXPR = RestOfForm()>
<MvELSE>
<MvIF EXPR = "{error_type EQ 'bad_char_in_name'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>ERROR: Illegal Character in Name</h1></center>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE><center><h3><font color="#ff0000">You have used a character that is not allowed in the 'Name' field.&[crlf];&[OFF];
&[ON];Only letters, numbers, blanks, and underscores are allowed.&[crlf];&[OFF];
&[ON];Correct it below and re-submit.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p></BLOCKQUOTE>&[crlf];&[OFF];
<MvEVAL EXPR = RestOfForm()>
<MvELSE>
<MvIF EXPR = "{error_type EQ 'no_subject'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>ERROR: No Subject</h1></center>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE><center><h3><font color="#ff0000">You forgot to fill in the 'Subject' field in your posting.&[crlf];&[OFF];
&[ON];Correct it below and re-submit. The necessary fields are: Name, Subject, and Message.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p></BLOCKQUOTE>&[crlf];&[OFF];
<MvEVAL EXPR = RestOfForm()>
<MvELSE>
<MvIF EXPR = "{error_type EQ 'link_subject'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>ERROR: Subject Links Ignored</h1></center>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE><center><h3><font color="#ff0000">Links are ignored in the 'Subject' field.&[crlf];&[OFF];
&[ON];Your posting contains nothing but a link.&[crlf];&[OFF];
&[ON];Correct it below and re-submit.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p></BLOCKQUOTE>&[crlf];&[OFF];
<MvEVAL EXPR = RestOfForm()>
<MvELSE>
<MvIF EXPR = "{error_type EQ 'no_body'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>ERROR: No Message</h1></center>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE><center><h3><font color="#ff0000">You forgot to fill in the 'Message' field in your posting.&[crlf];&[OFF];
&[ON];Correct it below and re-submit. The necessary fields are: Name, Subject, and Message.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p></BLOCKQUOTE>&[crlf];&[OFF];
<MvEVAL EXPR = RestOfForm()>
<MvELSE>
<MvIF EXPR = "{error_type EQ 'blocked_ip'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>ERROR: Not Accepting Postings</h1></center>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE><center><h3><font color="#ff0000">Sorry, we are currently&[crlf];&[OFF];
&[ON]; not accepting postings from IP address &[REMOTE_ADDR];.<br>&[crlf];&[OFF];
&[ON];If you feel that this is in error, please&[crlf];&[OFF];
&[ON]; contact the board administrator.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p></BLOCKQUOTE>&[crlf];&[OFF];
<MvEVAL EXPR = RestOfForm()>
<MvELSE>
&[ON];ERROR! Undefined.&[crlf];&[OFF];
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvEXIT>
</MvFUNCTION>
<MvCOMMENT>######################################################################
# Convert tags to long form. E.g. <xxx> becomes <xxx> #
# #
# This is necessary because Internet Explorer won't display textareas with #
# their HTML intact, but rather "executes" it as HTML. So we have to convert #
# HTML to harmless display form for display, and then back to active form #
# when receiving the textarea as submitted in a form for storage and actual use.#
# #
#####################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ConvertTags" PARAMETERS = "infield">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,less,longless)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,greater,longgreater)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,dquote,longdquote)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,quote,longquote)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,nbsp,longnbsp)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'[','[')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,']',']')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'(','(')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,')',')')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'!','!')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'?','?')}">
<MvCOMMENT>
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,';',';')}">
</MvCOMMENT>
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'=','=')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,asciichar(255),'')}">
<MvFUNCRETURN VALUE = "{infield}"></MvFUNCRETURN>
</MvFUNCTION>
<MvCOMMENT>######################################################################
# Convert tags to short form. E.g. <xxx> becomes <xxx> #
# #
# This is necessary because Internet Explorer won't display textareas with #
# their HTML intact, but rather "executes" it as HTML. So we have to convert #
# HTML to harmless display form for display, and then back to active form #
# when receiving the textarea as submitted in a form for storage and actual use.#
# #
#####################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ReconvertTags" PARAMETERS = "infield">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,longdquote,dquote)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,longnbsp,nbsp)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,longless,less)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,longgreater,greater)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,longquote,quote)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,longnbsp,nbsp)}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'[','[')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,']',']')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'(','(')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,')',')')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'!','!')}">
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'?','?')}">
<MvCOMMENT>
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,';',';')}">
</MvCOMMENT>
<MvASSIGN NAME = "infield" VALUE = "{glosub(infield,'=','=')}">
<MvFUNCRETURN VALUE = "{infield}"></MvFUNCRETURN>
</MvFUNCTION>
<MvFUNCTION NAME = "RestOfForm">
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
<MvIF EXPR = "{parm_admin_flag EQ 'y'}">
&[ON];<form method=POST action="&[documenturl];parm_func=post+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
<MvELSE>
&[ON];<form method=POST action="&[documenturl];parm_func=post">&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{is_followup EQ '1'}">
<MvASSIGN NAME = "form_origsubject" VALUE = "{ConvertTags(form_origsubject)}">
&[ON];<input type=hidden name="form_origsubject" value="&[form_origsubject];"></INPUT>&[crlf];&[OFF];
<MvASSIGN NAME = "form_origsubject" VALUE = "{ReconvertTags(form_origsubject)}">
&[ON];<input type=hidden name="form_origname" value="&[form_origname];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origemail" value="&[form_origemail];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="form_origdate" value="&[form_origdate];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="parm_followup_to" value="&[parm_followup_to];"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];<CENTER><TABLE>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Name:</TH><TD><input type=text name="form_name" value="&[form_name];" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
&[ON];<TR><TH align="left">E-Mail:</TH><TD><input type=text name="form_email" value="&[form_email];" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
<MvASSIGN NAME = "form_subject" VALUE = "{ConvertTags(form_subject)}">
<MvIF EXPR = "{subject_line EQ '1'}">
&[ON];<input type=hidden name="form_subject" value="&[form_subject];"></INPUT>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Subject:</TH><TD><b>&[form_subject];</b>&[crlf];&[OFF];
<MvELSE>
&[ON];<TR><TH align="left">Subject:</TH><TD><input type=text name="form_subject" value="&[form_subject];" size=&[textwidth]; maxlength=&[textwidth];></INPUT></TD></TR>&[crlf];&[OFF];
</MvIF>
<MvASSIGN NAME = "form_subject" VALUE = "{ReconvertTags(form_subject)}">
&[ON];<TR><TH align="left">Message:</TH><TD>&[crlf];&[OFF];
<MvIF EXPR = "{allow_html_body NE 'on' OR 'MvEVAL' CIN form_body}">
<MvASSIGN NAME = "form_body" VALUE = "{ConvertTags(form_body)}">
</MvIF>
&[ON];<textarea wrap="virtual" COLS=&[textwidth]; ROWS=10 name="form_body">&[form_body];</textarea></TD></TR>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Optional Link URL:</TH><TD><input type=text name="form_url" value="&[form_url];" size=&[textwidth]; maxlength=&[urlwidth];></INPUT></TD></TR>&[crlf];&[OFF];
&[ON];<TR><TH align="left">Link Title:</TH><TD><input type=text name="form_url_title" value="&[form_url_title];" size=&[textwidth]; maxlength=&[urlwidth];></INPUT></TD></TR>&[crlf];&[OFF];
&[ON];<MvIF EXPR = "{allow_gif EQ 'on'}">
&[ON];<TR><TH align="left">Optional Image URL:</TH><TD><input type=text name="form_img" value="&[form_img];" size=&[textwidth]; maxlength=&[urlwidth];></INPUT></TD></TR>&[crlf];&[OFF];
</MvIF>
&[ON];</TABLE>&[crlf];&[OFF];
&[ON];<br><input type=submit value="Post Message"></INPUT> <input type=reset></INPUT>&[crlf];&[OFF];
&[ON];</CENTER></form>&[crlf];&[OFF];
<MvEVAL EXPR = LinkLine(parm_admin_flag,parm_user,parm_pass)>
&[ON];&[banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "CreateDatabase">
<MvCREATE NAME = "&[dbname];" DATABASE = "&[database];"
FIELDS =
" dbselfnum NUMBER(10),
dbparentno NUMBER(10),
dbnumdesc NUMBER(10),
dbseqnum NUMBER(10),
dbnestlvl NUMBER(3),
dbdate CHAR(10),
dbtime CHAR(10),
dblongdate CHAR(30),
dbipaddr CHAR(15),
dbname1 CHAR(80),
dbemail CHAR(80),
dbsubject CHAR(80),
dblinkurl CHAR(80),
dblinktitl CHAR(80),
dbimageurl CHAR(80)
"
></MvCREATE>
<MvMAKEINDEX NAME = "&[dbname];" INDEXFILE = "{g.index_file1}"
EXPRESSION = "{dbseqnum}" FLAGS ="descending"></MvMAKEINDEX>
<MvCOMMENT> The following indices are used in admin processing. We need the database
records sorted in selfnum sequence (= date sequence) and author sequence
(and by date within author), ascending, respectively. </MvCOMMENT>
<MvMAKEINDEX NAME = "&[dbname];" INDEXFILE = "{g.index_file2}"
EXPRESSION = "{dbselfnum}" FLAGS ="ascending"></MvMAKEINDEX>
<MvMAKEINDEX NAME = "&[dbname];" INDEXFILE = "{g.index_file3}"
EXPRESSION = "{dbname1 $ '.' $ dbselfnum}"
FLAGS = "ascending"></MvMAKEINDEX>
<MvCOMMENT> Put in a special record (selfnum = super_root value) to serve as the
super-root for the main page. It also contains the count of records,
used for assigning a record number to each new posting (the selfnum). </MvCOMMENT>
<MvCLOSE NAME = "&[dbname];"> <MvCOMMENT> To omit msg when deleting db that exists. </MvCOMMENT>
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];">
<MvASSIGN NAME = "dbselfnum" VALUE = "{super_root}">
<MvCOMMENT> The super root's parent field will be used to hold the value of
last_rootnum, the current number of active roots. This is not ideal,
but avoids having to pass last_rootnum between pages as a parm. This
in turn avoids having it as part of the URL for messages on the main
board page. If it were part of the URL, visited links would keep getting
reset to their unvisited color every time a new root is added and a viewer
comes back to the main board page.
</MvCOMMENT>
<MvASSIGN NAME = "dbparentno" VALUE = "{'0'}">
<MvASSIGN NAME = "dbnumdesc" VALUE = "{'0'}"><MvCOMMENT> Won't be seen immediately </MvCOMMENT>
<MvASSIGN NAME = "dbseqnum" VALUE = "{max_seqnum_increment}">
<MvASSIGN NAME = "dbnestlvl" VALUE = "{'0'}">
<MvASSIGN NAME = "dbname1" VALUE = "{asciichar(254)}"><MvCOMMENT>So sorts last</MvCOMMENT>
<MvADD NAME = "&[dbname];"></MvADD>
<MvCLOSE NAME = "&[dbname];">
<MvASSIGN NAME = "db_just_created" VALUE = "{'1'}">
</MvFUNCTION>
<MvCOMMENT>######################################################################
# Message Board Admin #
# #
######################################################################</MvCOMMENT>
<MvFUNCTION NAME = "Admin">
<MvIF EXPR = "{parm_admin_func NE '' AND action EQ ''}">
<MvEVAL EXPR = Admin1()>
<MvEXIT>
<MvELSE>
<MvEVAL EXPR = Admin2()>
<MvEXIT>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "Admin1">
<MvIF EXPR = "{parm_admin_func EQ 'show_remove_by_thread'}">
<MvEVAL EXPR = ShowRemoveByThread()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_admin_func EQ 'show_remove_by_num'}">
<MvEVAL EXPR = ShowRemoveByNumber()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_admin_func EQ 'show_remove_by_date'}">
<MvEVAL EXPR = ShowRemoveByDate()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_admin_func EQ 'show_remove_by_author'}">
<MvEVAL EXPR = ShowRemoveByAuthor()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_admin_func EQ 'show_compress_database'}">
<MvEVAL EXPR = ShowCompressDatabase()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_admin_func EQ 'show_unwelcome_list'}">
<MvEVAL EXPR = ShowUnwelcomeList()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_admin_func EQ 'show_change_identity'}">
<MvEVAL EXPR = ShowChangeIdentity()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{parm_admin_func EQ 'show_change_settings'}">
<MvEVAL EXPR = GetSettings()>
<MvEVAL EXPR = ShowChangeSettings()>
<MvEXIT>
<MvELSE>
<MvASSIGN NAME = "username" VALUE = "{parm_user}">
<MvASSIGN NAME = "password" VALUE = "{parm_pass}">
<MvEVAL EXPR = CheckIdentity()>
<MvEVAL EXPR = ChooseAdminFunction(parm_user,parm_pass)>
<MvEXIT>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "Admin2">
<MvIF EXPR = "{'remove' IN action}">
<MvEVAL EXPR = AdminRemove()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{action EQ 'compress_database'}">
<MvEVAL EXPR = CompressDatabase(parm_user,parm_pass)>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{action EQ 'change_ip'}">
<MvEVAL EXPR = ChangeUnwelcomeList(parm_user,parm_pass)>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{action EQ 'change_identity'}">
<MvEVAL EXPR = ChangeIdentity("ShowChangeIdentity")>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{action EQ 'change_settings'}">
<MvEVAL EXPR = ChangeSettings(parm_user,parm_pass)>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{action EQ 'provide_identity'}">
<MvEVAL EXPR = ProvideIdentity("ShowProvideIdentity")>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{action EQ 'prove_identity'}">
<MvEVAL EXPR = CheckIdentity2("ShowProveIdentity")>
<MvEVAL EXPR = ChooseAdminFunction(username,password)>
<MvEXIT>
<MvELSE>
<MvEVAL EXPR = ShowProveIdentity()>
<MvEXIT>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "AdminRemove">
<MvIF EXPR = "{backintime EQ '' AND forwardintime EQ ''}"><MvCOMMENT> Not scrolling </MvCOMMENT>
<MvEVAL EXPR = Remove()>
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_thread'}">
<MvEVAL EXPR = ShowRemoveByThread()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_number'}">
<MvEVAL EXPR = ShowRemoveByNumber()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_date'}">
<MvEVAL EXPR = ShowRemoveByDate()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_author'}">
<MvEVAL EXPR = ShowRemoveByAuthor()>
<MvEXIT>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvEXIT>
</MvFUNCTION>
<MvCOMMENT>######################################################################
# Change Installation Settings #
# #
# This form is used to change Message Board variables such as the time zone, #
# the number of main postings to show at a time, and so on. The administrator #
# must supply a password after the first time. #
# #
#####################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowChangeSettings">
&[ON];&[header];&[crlf];&[OFF];
<MvASSIGN NAME = "header" VALUE = "{ConvertTags(header)}">
<MvASSIGN NAME = "footer" VALUE = "{ConvertTags(footer)}">
<MvASSIGN NAME = "linkline" VALUE = "{ConvertTags(linkline)}">
&[ON];<center><h1>&[title2]; - Change Configuration Settings</h1></center>&[crlf];&[OFF];
&[ON];<blockquote><blockquote>&[crlf];&[OFF];
&[ON];<p>Use this Change Settings form to change configuration variable settings. If you want to&[crlf];&[OFF];
&[ON];see the default settings, click the "Show Defaults" button below.</p>&[crlf];&[OFF];
&[ON];This and other Admin functions are available through the main Admin menu.&[crlf];&[OFF];
&[ON];Click here to visit the <a href="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title2]; Main Menu</a>.&[crlf];&[OFF];
&[ON];To view the message board, click on <a href="&[documenturl];parm_func=showmain+parm_starting_root=1+parm_admin_flag=y+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title];</a>.&[crlf];&[OFF];
&[ON];</blockquote></blockquote><p></p>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="change_settings"></INPUT>&[crlf];&[OFF];
&[ON];&[crlf];&[OFF];
&[ON];<div align="center"><table border width="85%">&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<td colspan=3 align=center><font size=6>Admin Page Settings</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Main Postings per Page in Remove by Thread</th>&[crlf];&[OFF];
&[ON];<td>How many main threads per page, with all their followups?</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="4" name="form_entries_thread"
value = "&[entries_thread];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Entries per Page in Remove by Message Number</th>&[crlf];&[OFF];
&[ON];<td>How many message numbers should be shown per page?</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="4" name="form_entries_msgnum"
value = "&[entries_msgnum];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Entries per Page in Remove by Date</th>&[crlf];&[OFF];
&[ON];<td>How many dates should be shown per page?</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="4" name="form_entries_date"
value = "&[entries_date];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Entries per Page in Remove by Author</th>&[crlf];&[OFF];
&[ON];<td>How many authors should be shown per page?</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="4" name="form_entries_author"
value = "&[entries_author];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];</table>&[crlf];&[OFF];
&[ON];<br>&[crlf];&[OFF];
&[ON];<div align="center"><table border width="85%">&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<td colspan=3 align=center><font size=6>Message Board Settings</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Main Postings per Page in Message Board</th>&[crlf];&[OFF];
&[ON];<td>How many top level topics per page, with all their followups?</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="4" name="form_num_postings"
value = "&[roots_to_view];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Time Zone</th>&[crlf];&[OFF];
&[ON];<td>Relative to GMT (e.g. Pacific is -8).</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="4" name="form_time_zone"
value = "&[time_zone];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Show FAQ?</th>&[crlf];&[OFF];
&[ON];<td>Show a link to the FAQ page on user pages?</td>&[crlf];&[OFF];
<MvIF EXPR = "{show_faq EQ 'on'}">
&[ON];<td><input type="checkbox" name="form_show_faq" checked></INPUT>&[crlf];&[OFF];
<MvELSE>
&[ON];<td><input type="checkbox" name="form_show_faq"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Quote Text?</th>&[crlf];&[OFF];
&[ON];<td>Add lines of the message to the reply comment area, preceded by colons?</td>&[crlf];&[OFF];
<MvIF EXPR = "{quote_text EQ 'on'}">
&[ON];<td><input type="checkbox" name="form_quote_text" checked></INPUT>&[crlf];&[OFF];
<MvELSE>
&[ON];<td><input type="checkbox" name="form_quote_text"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Use Time?</th>&[crlf];&[OFF];
&[ON];<td>Include time of day in postings (or just date)?</td>&[crlf];&[OFF];
<MvIF EXPR = "{use_time EQ 'on'}">
&[ON];<td><input type="checkbox" name="form_use_time" checked></INPUT>&[crlf];&[OFF];
<MvELSE>
&[ON];<td><input type="checkbox" name="form_use_time"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Preview Posting?</th>&[crlf];&[OFF];
&[ON];<td>Show a preview of a posting so user can change their mind?</td>&[crlf];&[OFF];
<MvIF EXPR = "{show_preview EQ 'on'}">
&[ON];<td><input type="checkbox" name="form_show_preview" checked></INPUT>&[crlf];&[OFF];
<MvELSE>
&[ON];<td><input type="checkbox" name="form_show_preview"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Allow GIF's in Message Form?</th>&[crlf];&[OFF];
&[ON];<td>Allow user to specify an optional image URL in post forms?</td>&[crlf];&[OFF];
<MvIF EXPR = "{allow_gif EQ 'on'}">
&[ON];<td><input type="checkbox" name="form_allow_gif" checked></INPUT>&[crlf];&[OFF];
<MvELSE>
&[ON];<td><input type="checkbox" name="form_allow_gif"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Allow HTML in Message Body?</th>&[crlf];&[OFF];
&[ON];<td>Allow user to include HTML tags in messages? If you disable this,&[crlf];&[OFF];
&[ON];you may want to explain this to users on post forms.</td>&[crlf];&[OFF];
<MvIF EXPR = "{allow_html_body EQ 'on'}">
&[ON];<td><input type="checkbox" name="form_allow_html_body" checked></INPUT>&[crlf];&[OFF];
<MvELSE>
&[ON];<td><input type="checkbox" name="form_allow_html_body"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Allow HTML in Subject Line?</th>&[crlf];&[OFF];
&[ON];<td>Allow user to include HTML tags (except links) in subject lines?</td>&[crlf];&[OFF];
<MvIF EXPR = "{allow_html_subj EQ 'on'}">
&[ON];<td><input type="checkbox" name="form_allow_html_subj" checked></INPUT>&[crlf];&[OFF];
<MvELSE>
&[ON];<td><input type="checkbox" name="form_allow_html_subj"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];</td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Subject Line in Follow-Up Form</th>&[crlf];&[OFF];
&[ON];<td>0 = Quote original subject, line is editable; 1 = Quote original subject, not editable;&[crlf];&[OFF];
&[ON];2 = Do not quote original subject, editable.</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="1" name="form_subject_line"
value = "&[subject_line];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];</table>&[crlf];&[OFF];
&[ON];<table border width="85%">&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Application Title</th>&[crlf];&[OFF];
&[ON];<td>Used in page headings and link labels.</td>&[crlf];&[OFF];
&[ON];<td><input type="text" size="&[textwidth];" name="form_title"
value = "&[title];"></INPUT></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Header</th>&[crlf];&[OFF];
&[ON];<td>Header for all pages.</td>&[crlf];&[OFF];
&[ON];<td><textarea name="form_header" wrap="virtual" rows="10"
cols=&[textwidth];>&[header];</textarea></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Footer</th>&[crlf];&[OFF];
&[ON];<td>Footer for all pages.</td>&[crlf];&[OFF];
&[ON];<td><textarea name="form_footer" wrap="virtual" rows="10"
cols=&[textwidth];>&[footer];</textarea></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Link Line</th>&[crlf];&[OFF];
&[ON];<td>If you want to supply your own link line, do it here.</td>&[crlf];&[OFF];
&[ON];<td><textarea name="form_linkline" wrap="virtual" rows="10"
cols=&[textwidth];>&[linkline];</textarea></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
&[ON];</table></ul>&[crlf];&[OFF];
&[ON];</div><center>&[crlf];&[OFF];
&[ON];<input type="submit" name="SubmitChanges" value="Submit Changes"></INPUT>&[crlf];&[OFF];
&[ON];<input type="reset"></INPUT>&[crlf];&[OFF];
&[ON];<input type="submit" name="ShowDefaults" value="Show Defaults"></INPUT>&[crlf];&[OFF];
&[ON];<input type="submit" name="ShowCurrentSettings" value="Show Current Settings"></INPUT>&[crlf];&[OFF];
&[ON];</form></center></p>&[crlf];&[OFF];
&[ON];<BLOCKQUOTE>Message Board created by Yahoo!.</BLOCKQUOTE>&[crlf];&[OFF];
<MvASSIGN NAME = "footer" VALUE = "{ReconvertTags(footer)}">
&[ON];</center><hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
<MvASSIGN NAME = "footer" VALUE = "{ConvertTags(footer)}">
<MvEXIT>
</MvFUNCTION>
<MvCOMMENT>##############################################################################
# Remove by Thread #
# This option is useful to see how the threads appear in the #
# Message Board. It can give you a better idea of whether or #
# not you want to remove the whole thread or just part of it. #
#############################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowRemoveByThread">
<MvASSIGN NAME = "removing_by" VALUE = "{'thread'}">
<MvEVAL EXPR = ShowRemoveByThreadHeader()>
<MvASSIGN NAME = "roots_displayed_count" VALUE = "{'0'}">
<MvASSIGN NAME = "traverse_function" VALUE = "{'AddAdminLine'}">
<MvASSIGN NAME = "roots_per_page" VALUE = "{entries_thread}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];" INDEXES = "&[index_file1];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
<MvEVAL EXPR = TraverseTree(parm_admin_flag,parm_user,parm_pass)>
<MvCOMMENT>
Actually, seqnum of record immediately after last posting on page, unless at eof.
But this doesn't matter, since that next rec wasn't shown, and we're only interested
in postings marked for removal. It just tells filter when to stop reading database.
</MvCOMMENT>
<MvASSIGN NAME = "ending_seqnum" VALUE = "{dbseqnum}">
<MvCLOSE NAME = "&[dbname];">
<MvEVAL EXPR = ShowRemoveByThreadWrapup()>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveByThreadHeader">
<MvEVAL EXPR = FindStart(entries_thread,parm_starting_root)> <MvCOMMENT> roots to view, root just on </MvCOMMENT>
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Remove Messages from &[title]; by Thread</h1></center>&[crlf];&[OFF];
&[ON];<ul>Select below to remove those postings that you wish to remove.&[crlf];&[OFF];
&[ON];A thread consists of a posting and all of its followups, if any. The posting&[crlf];&[OFF];
&[ON];need not be a main posting.&[crlf];&[OFF];
&[ON];Checking the checkbox next to the posting number will mark the whole thread for removal.<p>&[crlf];&[OFF];
&[ON];These messages have been left unsorted, so that you can see the order in&[crlf];&[OFF];
&[ON];which they appear in the main page. This will give you an idea of&[crlf];&[OFF];
&[ON];what the threads look like and is often more helpful than the sorted method&[crlf];&[OFF];
&[ON];(remove by message number).&[crlf];&[OFF];
&[ON];<p>Note: postings removed here will be <i>logically</i> removed. That is,&[crlf];&[OFF];
&[ON];they will no longer be displayed. To <i>physically</i> remove them, you must run&[crlf];&[OFF];
&[ON];<a href="&[documenturl];parm_func=admin+parm_admin_func=show_compress_database+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
&[ON];Compress Database</a>.</p>&[crlf];&[OFF];
&[ON];</ul></p><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = ShowRemoveLinkline()>
&[ON];</font></center><p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];+parm_starting_root=&[starting_root];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="remove"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="type" value="remove_by_thread"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="start_seqnum" value="&[starting_seqnum];"></INPUT>&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
&[ON];<table border width="90%">&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>X</th><th>Post #</th><th>Subject</th><th>Author</th><th>Date</th></tr>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveLinkline">
&[ON];<hr width=90%><center><font size=-1>&[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_thread+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Thread</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_num+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Message Number</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_date+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Date</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_author+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Author</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title2];</a> ]&[crlf];&[OFF];
&[ON];</font></center><hr width=90%>&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveByThreadWrapup">
&[ON];</table>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
&[ON];<input type=submit value="Remove Messages"></INPUT> <input type=reset></INPUT>&[crlf];&[OFF];
<MvIF EXPR = "{is_last_page NE '1'}">
&[ON];<input name="backintime" type="submit" value="Next Page"></INPUT>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{starting_root GT entries_thread}">
&[ON];<input name="forwardintime" type="submit" value="Previous Page"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];<input type=hidden name="end_seqnum" value="&[ending_seqnum];"></INPUT>&[crlf];&[OFF];
&[ON];</form></p>&[crlf];&[OFF];
<MvEVAL EXPR = ShowRemoveLinkline()>
&[ON];</center>&[crlf];&[OFF];
&[ON];&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveWrapup" PARAMETERS = "entries">
&[ON];</table>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
&[ON];<input type=submit value="Remove Messages"></INPUT> <input type=reset></INPUT>&[crlf];&[OFF];
<MvIF EXPR = "{is_last_page NE '1'}">
&[ON];<input name="forwardintime" type="submit" value="Next Page"></INPUT>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{starting_root GT entries}">
&[ON];<input name="backintime" type="submit" value="Previous Page"></INPUT>&[crlf];&[OFF];
</MvIF>
&[ON];<input type=hidden name="end_item" value="&[ending_item];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="end_self" value="&[ending_self];"></INPUT>&[crlf];&[OFF];
&[ON];</form></p>&[crlf];&[OFF];
<MvEVAL EXPR = ShowRemoveLinkline()>
&[ON];</center>&[crlf];&[OFF];
&[ON];&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "AddAdminLine" PARAMETERS = "x,y,z">
<MvASSIGN NAME = "disp_selfnum" VALUE = "{dbselfnum - big_bump}">
<MvIF EXPR = "{use_time EQ 'on'}">
<MvASSIGN NAME = "print_date" VALUE = "{dbtime $ ' ' $ dbdate}">
<MvELSE>
<MvASSIGN NAME = "print_date" VALUE = "{dbdate}">
</MvIF>
&[ON];<tr>&[crlf];&[OFF];
<MvASSIGN NAME = "l.name" VALUE = "{'form_' $ &[dbselfnum];}">
<MvASSIGN NAME = "msgurl" VALUE = "{documenturl $ 'parm_func=showmsg+parm_msgnum=' $ dbselfnum $ '+parm_admin_flag=y+parm_user='
$ parm_user $ '+parm_pass=' $ parm_pass}">
&[ON];<td align="center"><input type=checkbox name="&[l.name];" align="center"></INPUT></td>&[crlf];&[OFF];
&[ON];<th><b>&[disp_selfnum];</b></th>&[crlf];&[OFF];
<MvASSIGN NAME = "indent_count" VALUE = "{2}">
<MvASSIGN NAME = "indent_string" VALUE = "{''}">
<MvIF EXPR = "{removing_by EQ 'thread'}">
<MvWHILE EXPR = "{indent_count LE dbnestlvl}">
<MvASSIGN NAME = "indent_string" VALUE = "{indent_string $ indent}">
<MvASSIGN NAME = "indent_count" VALUE = "{indent_count + 1}">
</MvWHILE>
</MvIF>
&[ON];<td>&[indent_string];<a href="&[msgurl];">&[dbsubject];</a>&[crlf];&[OFF];
&[ON];</td><td>&[dbname1];</td><td align="center">&[print_date];<br></td>&[crlf];&[OFF];
&[ON];</tr>&[crlf];&[OFF];
</MvFUNCTION>
<MvCOMMENT>################################################################
# Remove By Number #
# This method is useful to see in what order the messages were #
# added to the Message Board. #
###############################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowRemoveByNumber">
<MvIF EXPR = "{parm_starting_root EQ ''}"> <MvASSIGN NAME = "parm_starting_root" VALUE = "{'1'}"> </MvIF>
<MvEVAL EXPR = FindStartingEntryNumber(entries_msgnum,backintime,forwardintime,parm_starting_root)>
<MvASSIGN NAME = "skip_amount" VALUE = "{starting_entry - 1}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];" INDEXES = "&[index_file2];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
<MvSKIP ROWS = "&[skip_amount];">
<MvEVAL EXPR = ShowRemoveByNumberHeader()>
<MvASSIGN NAME = "entry_count" VALUE = "{'0'}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'0'}">
<MvIF EXPR = "{dbselfnum EQ super_root}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
<MvELSE>
<MvWHILE EXPR = "{entry_count LT entries_msgnum}">
<MvEVAL EXPR = AddAdminLine(parm_admin_flag,parm_user,parm_pass)>
<MvASSIGN NAME = "entry_count" VALUE = "{entry_count + 1}">
<MvSKIP>
<MvIF EXPR = "{dbselfnum EQ super_root}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
<MvWHILESTOP></MvWHILESTOP>
</MvIF>
</MvWHILE>
</MvIF>
<MvASSIGN NAME = "ending_item" VALUE = "{dbselfnum}">
<MvCLOSE NAME = "&[dbname];">
<MvEVAL EXPR = ShowRemoveWrapup(entries_msgnum)>
<MvEXIT>
</MvFUNCTION>
<MvCOMMENT>#####################################################################################
# Find the starting point for scrolling in Removal pages. #
# #
# The other removal functions display in the opposite direction in time from remove #
# by thread, so they use a different starting entry variable and different button logic. #
# #
####################################################################################</MvCOMMENT>
<MvFUNCTION NAME = "FindStartingEntryNumber" PARAMETERS = "num_to_view,backintime,forwardintime,startingroot">
<MvIF EXPR = "{forwardintime NE ''}">
<MvASSIGN NAME = "starting_entry" VALUE = "{startingroot + num_to_view}">
<MvELSE>
<MvIF EXPR = "{backintime NE ''}">
<MvASSIGN NAME = "starting_entry" VALUE = "{startingroot - num_to_view}">
<MvELSE>
<MvASSIGN NAME = "starting_entry" VALUE = "{'1'}">
</MvIF>
</MvIF>
<MvASSIGN NAME = "starting_root" VALUE = "{starting_entry}">
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveByNumberHeader">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Remove Messages from &[title]; by Number</h1></center>&[crlf];&[OFF];
&[ON];<ul>Select below to remove those postings you wish to remove.&[crlf];&[OFF];
&[ON];Checking the checkbox under "Remove?" will mark the whole thread for removal.&[crlf];&[OFF];
&[ON];Any followups of a posting marked for removal will also be removed.&[crlf];&[OFF];
&[ON];<p>Note: postings removed here will be <i>logically</i> removed. That is,&[crlf];&[OFF];
&[ON];they will no longer be displayed. To <i>physically</i> remove them, you must run&[crlf];&[OFF];
&[ON];<a href="&[documenturl];parm_func=admin+parm_admin_func=show_compress_database+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
&[ON];Compress Database</a>.</p>&[crlf];&[OFF];
&[ON];</ul><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = ShowRemoveLinkline()>
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];+parm_starting_root=&[starting_root];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="remove"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="type" value="remove_by_number"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="start_item" value="&[dbselfnum];"></INPUT>&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
&[ON];<table border width="90%">&[crlf];&[OFF];
&[ON];<tr><th>Remove?</th><th>Post # </th><th>Subject </th><th> Author</th><th> Date</th></tr>&[crlf];&[OFF];&[crlf];&[OFF];
</MvFUNCTION>
<MvCOMMENT>######################################################################
# Remove By Date #
# Using this method allows you to delete all messages posted on #
# a certain date. #
#####################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowRemoveByDate">
<MvCOMMENT> Message number order is also date order, so same index used. </MvCOMMENT>
<MvEVAL EXPR = FindStartingEntryDate()>
<MvEVAL EXPR = ShowRemoveByDateHeader()>
<MvASSIGN NAME = "entry_count" VALUE = "{'1'}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'0'}">
<MvWHILE EXPR = "{entry_count LE entries_date AND NOT &[dbname];.d.eof}">
<MvIF EXPR = "{dbselfnum EQ super_root}"><MvWHILESTOP></MvWHILESTOP></MvIF>
<MvASSIGN NAME = "date_save" VALUE = "{dbdate}">
<MvASSIGN NAME = "self_save" VALUE = "{dbselfnum}">
<MvASSIGN NAME = "msg_count" VALUE = "{'0'}">
<MvEVAL EXPR = ShowRemoveCodeFrag()>
<MvWHILE EXPR = "{dbdate EQ date_save AND NOT &[dbname];.d.eof}">
<MvASSIGN NAME = "self_save" VALUE = "{dbselfnum}">
<MvEVAL EXPR = ShowRemoveCodeFrag()>
</MvWHILE>
&[ON];<tr>&[crlf];&[OFF];
<MvASSIGN NAME = "okdate" VALUE = "{glosub(date_save,'/','_')}">
<MvASSIGN NAME = "l.filename" VALUE = "{'form_' $ okdate}">
&[ON];<td align="center"><input align="center" type=checkbox name="&[l.filename];"></INPUT></td>&[crlf];&[OFF];
&[ON];<th>&[date_save];</th><td align="center">&[msg_count];</td>&[crlf];&[OFF];
&[ON];<td>&[crlf];&[OFF];
<MvASSIGN NAME = "count" VALUE = "{'1'}">
<MvWHILE EXPR = "{count LE msg_count}">
<MvASSIGN NAME = "xx" VALUE = "{'msg_array' $ count}">
<MvASSIGN NAME = "yy" VALUE = "{&[xx];}">
&[ON];&[yy];&[crlf];&[OFF];
<MvASSIGN NAME = "count" VALUE = "{count + 1}">
</MvWHILE>
&[ON];<br></td></tr>&[crlf];&[OFF];
<MvASSIGN NAME = "entry_count" VALUE = "{entry_count + 1}">
<MvASSIGN NAME = "msg_count" VALUE = "{'0'}">
</MvWHILE>
<MvIF EXPR = "{dbselfnum EQ super_root}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
</MvIF>
<MvASSIGN NAME = "ending_item" VALUE = "{date_save}">
<MvASSIGN NAME = "ending_self" VALUE = "{self_save}">
<MvCLOSE NAME = "&[dbname];">
<MvEVAL EXPR = ShowRemoveWrapup(entries_date)>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "FindStartingEntryDate">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];" INDEXES = "&[index_file2];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
<MvIF EXPR = "{start_item EQ ''}">
<MvASSIGN NAME = "starting_item" VALUE = "{dbdate}">
<MvASSIGN NAME = "starting_self" VALUE = "{dbselfnum}">
<MvFUNCRETURN></MvFUNCRETURN> <MvCOMMENT> Start with 1st entry </MvCOMMENT>
</MvIF>
<MvIF EXPR = "{forwardintime NE ''}">
<MvFIND NAME = "&[dbname];" VALUE = "&[end_self];" EXACT = "EXACT"></MvFIND>
<MvWHILE EXPR = "{dbdate EQ end_item AND NOT &[dbname];.d.eof}">
<MvSKIP>
</MvWHILE>
<MvASSIGN NAME = "starting_item" VALUE = "{dbdate}">
<MvASSIGN NAME = "starting_self" VALUE = "{dbselfnum}">
<MvELSE>
<MvIF EXPR = "{backintime NE ''}">
<MvFIND NAME = "&[dbname];" VALUE = "&[start_self];" EXACT = "EXACT"></MvFIND>
<MvASSIGN NAME = "entry_save" VALUE = "{start_item}">
<MvASSIGN NAME = "self_save" VALUE = "{start_self}">
<MvASSIGN NAME = "entry_count" VALUE = "{0}">
<MvWHILE EXPR = "{entry_count LT entries_date AND NOT &[dbname];.d.eof}">
<MvSKIP ROWS = -1>
<MvIF EXPR = "{dbdate NE entry_save}">
<MvASSIGN NAME = "entry_save" VALUE = "{dbdate}">
<MvASSIGN NAME = "entry_count" VALUE = "{entry_count + 1}">
</MvIF>
</MvWHILE>
<MvASSIGN NAME = "starting_item" VALUE = "{entry_save}">
<MvWHILE EXPR = "{dbdate EQ entry_save AND NOT &[dbname];.d.eof}">
<MvASSIGN NAME = "self_save" VALUE = "{dbselfnum}">
<MvSKIP ROWS = -1>
</MvWHILE>
<MvASSIGN NAME = "starting_self" VALUE = "{self_save}">
</MvIF>
</MvIF>
<MvFIND NAME = "&[dbname];" VALUE = "&[starting_self];" EXACT = "EXACT"></MvFIND>
<MvCOMMENT> If 1st rec via index, no prev button. EOF also occurs pre-rec1. </MvCOMMENT>
<MvSKIP ROWS = -1>
<MvIF EXPR = "{NOT &[dbname];.d.eof}">
<MvSKIP>
<MvASSIGN NAME = "starting_root" VALUE = "{entries_date + 1}">
<MvELSE>
<MvASSIGN NAME = "starting_root" VALUE = "{0}">
<MvFIND NAME = "&[dbname];" VALUE = "&[starting_self];" EXACT = "EXACT"></MvFIND>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveByDateHeader">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Remove Messages from &[title]; by Date</h1></center>&[crlf];&[OFF];
&[ON];<ul>Select below to remove those postings you wish to remove.&[crlf];&[OFF];
&[ON];Checking the checkbox beside a date will mark for removal all postings &[crlf];&[OFF];
&[ON];that occurred on that date.&[crlf];&[OFF];
&[ON];Any followups of a posting marked for removal will also be removed.&[crlf];&[OFF];
&[ON];<p>Note: postings removed here will be <i>logically</i> removed. That is,&[crlf];&[OFF];
&[ON];they will no longer be displayed. To <i>physically</i> remove them, you must run&[crlf];&[OFF];
&[ON];<a href="&[documenturl];parm_func=admin+parm_admin_func=show_compress_database+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
&[ON];Compress Database</a>.</p>&[crlf];&[OFF];
&[ON];</ul><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = ShowRemoveLinkline()>
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];+parm_starting_root=&[starting_root];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="remove_by_date_or_author"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="type" value="remove_by_date"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="start_item" value="&[starting_item];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="start_self" value="&[starting_self];"></INPUT>&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
&[ON];<table border width="90%">&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Remove?</th><th>Date</th><th># of Messages</th><th>Message Numbers<br></th></tr>&[crlf];&[OFF];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveCodeFrag">
<MvASSIGN NAME = "disp_selfnum" VALUE = "{dbselfnum - big_bump}">
<MvASSIGN NAME = "msgurl" VALUE ="{documenturl $ 'parm_func=showmsg+parm_msgnum=' $ dbselfnum $
'+parm_admin_flag=y+parm_user=' $ parm_user $ '+parm_pass=' $ parm_pass}">
<MvASSIGN NAME = "msg_count" VALUE = "{msg_count + 1}">
<MvASSIGN NAME = "{'msg_array' $ msg_count}"
VALUE = "{'<a href=\"&[msgurl];\"\>' $ disp_selfnum $ '</a\>'}">
<MvSKIP>
</MvFUNCTION>
<MvCOMMENT>#####################################################################################
# Find the starting point for scrolling in author removal pages. #
# #
# Multiple records in sequence can have the same author, so don't count records when scrolling,#
# but *entries* (i.e. distinct authors). When scrolling to the previous page, find the #
# start_item for the current page and back up n entries. For forward scrolling, find the #
# end_item for the current page and move forward to the next entry. #
####################################################################################</MvCOMMENT>
<MvFUNCTION NAME = "FindStartingEntryAuthor">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];" INDEXES = "&[index_file3];">
<MvFILTER NAME = "&[dbname];" FILTER = "{NOT &[dbname];.d.deleted}">
<MvIF EXPR = "{start_item EQ ''}">
<MvASSIGN NAME = "starting_item" VALUE = "{dbname1}">
<MvASSIGN NAME = "starting_self" VALUE = "{dbselfnum}">
<MvFUNCRETURN></MvFUNCRETURN> <MvCOMMENT> Start with 1st entry </MvCOMMENT>
</MvIF>
<MvIF EXPR = "{forwardintime NE ''}">
<MvASSIGN NAME = "work_item" VALUE = "{'&[end_item];' $ '.' $ '&[end_self];'}">
<MvFIND NAME = "&[dbname];" VALUE = "&[work_item];" EXACT = "EXACT"></MvFIND>
<MvWHILE EXPR = "{dbname1 EQ end_item AND NOT &[dbname];.d.eof}">
<MvSKIP>
</MvWHILE>
<MvASSIGN NAME = "starting_item" VALUE = "{dbname1}">
<MvASSIGN NAME = "starting_self" VALUE = "{dbselfnum}">
<MvELSE>
<MvIF EXPR = "{backintime NE ''}">
<MvASSIGN NAME = "work_item" VALUE = "{'&[start_item];' $ '.' $ '&[start_self];'}">
<MvFIND NAME = "&[dbname];" VALUE = "&[work_item];" EXACT = "EXACT"></MvFIND>
<MvASSIGN NAME = "entry_save" VALUE = "{start_item}">
<MvASSIGN NAME = "entry_self" VALUE = "{start_self}">
<MvASSIGN NAME = "entry_count" VALUE = "{0}">
<MvWHILE EXPR = "{entry_count LT entries_author AND NOT &[dbname];.d.eof}">
<MvSKIP ROWS = -1>
<MvIF EXPR = "{dbname1 NE entry_save}">
<MvASSIGN NAME = "entry_save" VALUE = "{dbname1}">
<MvASSIGN NAME = "entry_self" VALUE = "{dbselfnum}">
<MvASSIGN NAME = "entry_count" VALUE = "{entry_count + 1}">
</MvIF>
</MvWHILE>
<MvASSIGN NAME = "starting_item" VALUE = "{entry_save}">
<MvASSIGN NAME = "starting_self" VALUE = "{entry_self}">
</MvIF>
</MvIF>
<MvASSIGN NAME = "work_item" VALUE = "{'&[starting_item];' $ '.' $ '&[starting_self];'}">
<MvFIND NAME = "&[dbname];" VALUE = "&[work_item];" EXACT = "EXACT"></MvFIND>
<MvCOMMENT> If 1st rec via index, no prev button. EOF also occurs pre-rec1. </MvCOMMENT>
<MvSKIP ROWS = -1>
<MvIF EXPR = "{NOT &[dbname];.d.eof}">
<MvSKIP>
<MvASSIGN NAME = "starting_root" VALUE = "{entries_author + 1}">
<MvELSE>
<MvASSIGN NAME = "starting_root" VALUE = "{0}">
<MvFIND NAME = "&[dbname];" VALUE = "&[work_item];" EXACT = "EXACT"></MvFIND>
</MvIF>
</MvFUNCTION>
<MvCOMMENT>#########################################################################
# Remove By Author #
# This option makes a list of all known authors and then groups #
# together their postings and allows you to remove them all at once. #
########################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowRemoveByAuthor">
<MvEVAL EXPR = FindStartingEntryAuthor()>
<MvEVAL EXPR = ShowRemoveByAuthorHeader()>
<MvASSIGN NAME = "entry_count" VALUE = "{'1'}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'0'}">
<MvWHILE EXPR = "{entry_count LE entries_author AND NOT &[dbname];.d.eof}">
<MvIF EXPR = "{dbselfnum EQ super_root OR &[dbname];.d.totrec EQ 1}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
<MvWHILESTOP></MvWHILESTOP>
</MvIF>
<MvASSIGN NAME = "author_save" VALUE = "{dbname1}">
<MvASSIGN NAME = "self_save" VALUE = "{dbselfnum}">
<MvASSIGN NAME = "msg_count" VALUE = "{'0'}">
<MvEVAL EXPR = ShowRemoveCodeFrag()>
<MvIF EXPR = "{&[dbname];.d.eof}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
</MvIF>
<MvWHILE EXPR = "{dbname1 EQ author_save AND NOT &[dbname];.d.eof}">
<MvIF EXPR = "{dbselfnum EQ super_root}"> <MvSKIP> </MvIF>
<MvEVAL EXPR = ShowRemoveCodeFrag()>
<MvIF EXPR = "{&[dbname];.d.eof}">
<MvASSIGN NAME = "is_last_page" VALUE = "{'1'}">
</MvIF>
</MvWHILE>
&[ON];<tr>&[crlf];&[OFF];
<MvASSIGN NAME = "okname" VALUE = "{glosub(author_save,' ','_')}">
<MvASSIGN NAME = "l.filename" VALUE = "{'form_' $ okname}">
&[ON];<td align="center"><input type=checkbox name="&[l.filename];" align="center"></INPUT></td>&[crlf];&[OFF];
&[ON];<th align="left"> &[author_save]; </th><td align="center">&[msg_count];</td>&[crlf];&[OFF];
&[ON];<td>&[crlf];&[OFF];
<MvASSIGN NAME = "count" VALUE = "{'1'}">
<MvWHILE EXPR = "{count LE msg_count}">
<MvASSIGN NAME = "xx" VALUE = "{'msg_array' $ count}">
<MvASSIGN NAME = "yy" VALUE = "{&[xx];}">
&[ON];&[yy];&[crlf];&[OFF];
<MvASSIGN NAME = "count" VALUE = "{count + 1}">
</MvWHILE>
&[ON];<br></td></tr>&[crlf];&[OFF];
<MvASSIGN NAME = "entry_count" VALUE = "{entry_count + 1}">
<MvASSIGN NAME = "msg_count" VALUE = "{'0'}">
</MvWHILE>
<MvIF EXPR = "{dbselfnum EQ super_root}">
<MvASSIGN NAME = "ending_item" VALUE = "{asciichar(254)}">
<MvASSIGN NAME = "ending_self" VALUE = "{super_root}">
<MvELSE>
<MvASSIGN NAME = "ending_item" VALUE = "{author_save}">
<MvASSIGN NAME = "ending_self" VALUE = "{self_save}">
</MvIF>
<MvCLOSE NAME = "&[dbname];">
<MvEVAL EXPR = ShowRemoveWrapup(entries_author)>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowRemoveByAuthorHeader">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Remove Messages from &[title]; by Author</h1></center>&[crlf];&[OFF];
&[ON];<ul>Checking the checkbox beside the name of an author will mark for removal&[crlf];&[OFF];
&[ON];all postings which that author has created.&[crlf];&[OFF];
&[ON];Any followups of a posting marked for removal will also be removed.&[crlf];&[OFF];
&[ON];<p>Note: postings removed here will be <i>logically</i> removed. That is,&[crlf];&[OFF];
&[ON];they will no longer be displayed. To <i>physically</i> remove them, you must run&[crlf];&[OFF];
&[ON];<a href="&[documenturl];parm_func=admin+parm_admin_func=show_compress_database+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
&[ON];Compress Database</a>.</p>&[crlf];&[OFF];
&[ON];</ul><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = ShowRemoveLinkline()>
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];+parm_starting_root=&[starting_root];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="remove_by_date_or_author"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="type" value="remove_by_author"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="start_item" value="&[starting_item];"></INPUT>&[crlf];&[OFF];
&[ON];<input type=hidden name="start_self" value="&[starting_self];"></INPUT>&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
&[ON];<table border width="90%">&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th>Remove?</th><th>Author</th><th># of Messages</th><th>Message #'s<br></th></tr>&[crlf];&[OFF];
</MvFUNCTION>
<MvCOMMENT>#################################################################
# Provide Username and Password #
# To use admin, user must provide name and password matching #
# stored values. #
################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowProveIdentity">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Welcome to Message Board Administration!</h1></center>&[crlf];&[OFF];
&[ON];<center>Please provide your user name and password below. All admin functions&[crlf];&[OFF];
&[ON];require name and password.&[crlf];&[OFF];
&[ON];</center><p></p><hr width=90%>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="prove_identity"></INPUT>&[crlf];&[OFF];
&[ON];<center><table border=0>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align=left>Username: </th><td><input type=text name="username" value=&[username];></input><br></td>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];<th align=left>Password: </th><td><input type=password name="password" value=&[password];></input><br></td>&[crlf];&[OFF];
&[ON];</tr><tr></tr><tr></tr><tr></tr><tr>&[crlf];&[OFF];
&[ON];<td align=center><input type=submit value="Submit"></INPUT> </td><td align=center><input type=reset></INPUT></td>&[crlf];&[OFF];
&[ON];</tr></table></center>&[crlf];&[OFF];
&[ON];</form></p><hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "Footer">
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvCOMMENT>##########################################################################
# First time in, show welcome and continue button. #
#########################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowWelcome">
&[ON];<html><head><title>Message Board</title></head><body bgcolor=#FFFFFF text=#000000>&[crlf];&[OFF];
&[ON];<center><h1>Welcome to Message Board Administration!</h1></center>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin">&[crlf];&[OFF];
&[ON];<br><br><br><br>&[crlf];&[OFF];
&[ON];<center><input type=submit value="Continue"></INPUT>&[crlf];&[OFF];
&[ON];</form><hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvCOMMENT>#################################################################
# Provide Username and Password #
# The first time in, the admin must set up his or her password. #
################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowProvideIdentity">
&[ON];<html><head><title>Message Board</title></head><body bgcolor=#FFFFFF text=#000000>&[crlf];&[OFF];
&[ON];<center><h1>Welcome to Message Board Administration!</h1></center>&[crlf];&[OFF];
&[ON];<ul>Fill out the form below to provide your user name and password.&[crlf];&[OFF];
&[ON];Please make a note of these values. All admin functions require name and password.&[crlf];&[OFF];
&[ON];<p><b><font color="#ff0000"><center>To use Message Board Admin after this, make sure you &[crlf];&[OFF];
&[ON];bookmark this page now.</p></font>&[crlf];&[OFF];
&[ON];<p>You may create multiple message boards. Make one copy of this ".mv" file for each&[crlf];&[OFF];
&[ON];message board, and name each ".mv" file uniquely. The .mv file(s) can be anywhere&[crlf];&[OFF];
&[ON];under your Documents directory.&[crlf];&[OFF];
&[ON];</center></b></p><p></p></ul><hr width=90%>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="provide_identity"></INPUT>&[crlf];&[OFF];
&[ON];<center><table border=0>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align=left>Username: </th><td><input type=text name="p_user" value="&[p_user];"></input><br></td>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];<th align=left>Password: </th><td><input type=password name="p_pass1" value="&[p_pass1];"></input><br></td>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];<th align=left>Re-type Password: </th><td><input type=password name="p_pass2" value="&[p_pass2];"></input><br></td>&[crlf];&[OFF];
&[ON];</tr><tr></tr><tr></tr><tr></tr><tr></tr><tr>&[crlf];&[OFF];
&[ON];<td align=center><input type=submit value="Submit"></INPUT> </td><td align=center><input type=reset></INPUT></td>&[crlf];&[OFF];
&[ON];</tr></table></center>&[crlf];&[OFF];
&[ON];</form></p>&[crlf];&[OFF];
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ShowCompressDatabase">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Compress Database</h1></center>&[crlf];&[OFF];
&[ON];<blockquote><ul>Use this feature to remove database records that have &[crlf];&[OFF];
&[ON];been marked for deletion since the last compression. This will reduce the &[crlf];&[OFF];
&[ON];size of the database and improve the speed of the board functions.&[crlf];&[OFF];
&[ON];The compression process&[crlf];&[OFF];
&[ON];may take a long time. The larger the database, the longer it takes.&[crlf];&[OFF];
&[ON];</ul></blockquote><p></p>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];+parm_starting_root=&[starting_root];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="compress_database"></INPUT>&[crlf];&[OFF];
&[ON];<center><font size=3><input type=submit value="Compress"></INPUT></center>&[crlf];&[OFF];
&[ON];</form>&[crlf];&[OFF];
&[ON];<center><a href="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title2]; Main Menu</a></center>&[crlf];&[OFF];
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ShowUnwelcomeList">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>IP Blocking</h1></center>&[crlf];&[OFF];
<MvIF EXPR = "{fexists(unwelcomelist)}">
&[ON];<center><ul><b>Visitors whose IP is in this list cannot post.</b><br>&[crlf];&[OFF];
&[ON];Checking the checkbox under "Remove?" will mark the IP address for removal.&[crlf];&[OFF];
&[ON];</ul></center><p></p>&[crlf];&[OFF];
</MvIF>
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];+parm_starting_root=&[starting_root];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="change_ip"></INPUT>&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
&[ON];<table width="90%">&[crlf];&[OFF];
<MvIF EXPR = "{fexists(unwelcomelist)}">
&[ON];<tr><th align=center>Remove?</th></tr>&[crlf];&[OFF];&[crlf];&[OFF];
<MvIMPORT FILE = "&[unwelcomelist];" FIELDS = "ip" DELIMITER = "">
<MvASSIGN NAME = "x" VALUE = "{glosub(ip,'.','d')}">
<MvASSIGN NAME = "x" VALUE = "{glosub(x,'*','w')}">
&[ON];<tr><td align="center"><input type=checkbox name="form_&[x];" align="center"></INPUT></td>&[crlf];&[OFF];
&[ON];<th align="left"> &[ip]; </th></tr>&[crlf];&[OFF];
</MvIMPORT>
</MvIF>
&[ON];</tr></table></center><br>&[crlf];&[OFF];
&[ON];<hr width="90%">&[crlf];&[OFF];
&[ON];<center>&[crlf];&[OFF];
&[ON];<table width="90%">&[crlf];&[OFF];
&[ON];<tr><th>Add the following IP addresses (wildcard OK at right end):</th></tr>&[crlf];&[OFF];
&[ON];<tr><td align=center><input type=text name="ip_address1"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><td align=center><input type=text name="ip_address2"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><td align=center><input type=text name="ip_address3"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><td align=center><input type=text name="ip_address4"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];<tr><td align=center><input type=text name="ip_address5"></INPUT></td></tr>&[crlf];&[OFF];
&[ON];</tr></table></center><br>&[crlf];&[OFF];
&[ON];<center><font size=3><input type=submit value="Submit"></INPUT> &[crlf];&[OFF];
&[ON];<input type=reset></INPUT></font></center>&[crlf];&[OFF];
&[ON];</form>&[crlf];&[OFF];
&[ON];<center><a href="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title2]; Main Menu</a></center>&[crlf];&[OFF];
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvCOMMENT>#################################################################
# Change Identity #
# By calling this section of the script, the admin can change his or #
# her password. #
################################################################</MvCOMMENT>
<MvFUNCTION NAME = "ShowChangeIdentity">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Change &[title]; Admin<br>User Name or Password</h1></center>&[crlf];&[OFF];
&[ON];<blockquote>Fill out the form below to change your user name or password.&[crlf];&[OFF];
&[ON];If new user name is left blank, your old one will be assumed.</blockquote>&[crlf];&[OFF];
&[ON];<p></p><hr width=90%>&[crlf];&[OFF];
&[ON];<p>&[crlf];&[OFF];
&[ON];<form method=POST action="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[crlf];&[OFF];
&[ON];<input type=hidden name="action" value="change_identity"></INPUT>&[crlf];&[OFF];
&[ON];<center><table border=0>&[crlf];&[OFF];
&[ON];<tr>&[crlf];&[OFF];
&[ON];<th align=left>User Name: </th><td><input type=text name="username" value="&[username];"></INPUT><br></td>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];<th align=left>Password: </th><td><input type=password name="password" value="&[password];"></INPUT><br></td>&[crlf];&[OFF];
&[ON];</tr><tr> </tr><tr>&[crlf];&[OFF];
&[ON];<th align=left>New User Name: </th><td><input type=text name="new_username" value="&[new_username];"></INPUT><br></td>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];<th align=left>New Password: </th><td><input type=password name="passwd_1" value="&[passwd_1];"></INPUT><br></td>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];<th align=left>Re-type New Password: </th><td><input type=password name="passwd_2" value="&[passwd_2];"></INPUT><br></td>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];</tr><tr>&[crlf];&[OFF];
&[ON];<td align=center><input type=submit value="Change Identity"></INPUT> </td><td align=center><input type=reset></INPUT></td>&[crlf];&[OFF];
&[ON];</tr></table></center>&[crlf];&[OFF];
&[ON];</form></p>&[crlf];&[OFF];
&[ON];<center><a href="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title2]; Main Menu</a></center>&[crlf];&[OFF];
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvFUNCTION>
<MvFUNCTION NAME = "ChangeSettings" PARAMETERS = "uname,pass">
<MvIF EXPR = "{SubmitChanges NE ''}">
<MvASSIGN NAME = "xxx" VALUE = "{fdelete(configfile)}">
<MvEVAL EXPR = CopySettings()>
<MvEVAL EXPR = ExportSettings()>
<MvEVAL EXPR = ChooseAdminFunction(uname,pass)>
<MvEXIT>
<MvELSE> <MvCOMMENT> Show Defaults </MvCOMMENT>
<MvIF EXPR = "{ShowDefaults NE ''}">
<MvEVAL EXPR = AssignDefaultSettings()>
<MvEVAL EXPR = ShowChangeSettings()>
<MvEXIT>
<MvELSE>
<MvIF EXPR = "{ShowCurrentSettings NE ''}">
<MvEVAL EXPR = GetSettings()>
<MvEVAL EXPR = ShowChangeSettings()>
<MvEXIT>
</MvIF>
</MvIF>
</MvIF>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME ="CopySettings">
<MvASSIGN NAME = "roots_to_view" VALUE = "{ConvertTags(form_num_postings)}">
<MvASSIGN NAME = "entries_thread" VALUE = "{ConvertTags(form_entries_thread)}">
<MvASSIGN NAME = "entries_msgnum" VALUE = "{ConvertTags(form_entries_msgnum)}">
<MvASSIGN NAME = "entries_date" VALUE = "{ConvertTags(form_entries_date)}">
<MvASSIGN NAME = "entries_author" VALUE = "{ConvertTags(form_entries_author)}">
<MvASSIGN NAME = "time_zone" VALUE = "{ConvertTags(form_time_zone)}">
<MvASSIGN NAME = "show_faq" VALUE = "{ConvertTags(form_show_faq)}">
<MvASSIGN NAME = "quote_text" VALUE = "{ConvertTags(form_quote_text)}">
<MvASSIGN NAME = "use_time" VALUE = "{ConvertTags(form_use_time)}">
<MvASSIGN NAME = "show_preview" VALUE = "{ConvertTags(form_show_preview)}">
<MvASSIGN NAME = "allow_gif" VALUE = "{ConvertTags(form_allow_gif)}">
<MvASSIGN NAME = "allow_html_body" VALUE = "{ConvertTags(form_allow_html_body)}">
<MvASSIGN NAME = "allow_html_subj" VALUE = "{ConvertTags(form_allow_html_subj)}">
<MvASSIGN NAME = "subject_line" VALUE = "{ConvertTags(form_subject_line)}">
<MvASSIGN NAME = "title" VALUE = "{ConvertTags(form_title)}">
<MvASSIGN NAME = "header" VALUE = "{ReconvertTags(form_header)}">
<MvASSIGN NAME = "footer" VALUE = "{ReconvertTags(form_footer)}">
<MvASSIGN NAME = "title2" VALUE = "{title $ ' Admin'}">
<MvASSIGN NAME = "form_linkline" VALUE = "{ReconvertTags(form_linkline)}">
<MvEVAL EXPR = CopySettingsLinkline()>
</MvFUNCTION>
<MvFUNCTION NAME = "CopySettingsLinkline">
<MvCOMMENT> If "showmain+1" is in linkline, insert title after it. </MvCOMMENT>
<MvASSIGN NAME = "work" VALUE = "{''}">
<MvASSIGN NAME = "a1" VALUE = "{'showmain+1\"\>' CIN form_linkline}">
<MvIF EXPR = "{a1 GT '0'}">
<MvASSIGN NAME = "work"
VALUE = "{work $ substring(form_linkline,1,a1+11)}">
<MvASSIGN NAME = "work"
VALUE = "{work $ title}">
<MvASSIGN NAME = "a2"
VALUE = "{'<' CIN substring(form_linkline,a1+12,len(form_linkline)-(a1+11))}">
<MvASSIGN NAME = "work"
VALUE = "{work $ substring(form_linkline,a1+11+a2,len(form_linkline)-(a1+9+a2))}">
<MvASSIGN NAME = "linkline" VALUE = "{work}">
<MvELSE>
<MvASSIGN NAME = "linkline" VALUE = "{form_linkline}">
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "ExportSettings">
<MvASSIGN NAME = "glob" VALUE = "{
roots_to_view
$ delim $ entries_thread
$ delim $ entries_msgnum
$ delim $ entries_date
$ delim $ entries_author
$ delim $ time_zone
$ delim $ show_faq
$ delim $ quote_text
$ delim $ use_time
$ delim $ show_preview
$ delim $ allow_gif
$ delim $ allow_html_body
$ delim $ allow_html_subj
$ delim $ subject_line
$ delim $ title
$ delim $ header
$ delim $ footer
$ delim $ linkline
}">
<MvEXPORT FILE = "&[configfile];" DELIMITER = "%%%%%%" FIELDS = "glob"></MvEXPORT>
</MvFUNCTION>
<MvFUNCTION NAME = "AssignDefaultSettings">
<MvASSIGN NAME = "roots_to_view" VALUE = "{'20'}">
<MvASSIGN NAME = "entries_thread" VALUE = "{'20'}">
<MvASSIGN NAME = "entries_msgnum" VALUE = "{'20'}">
<MvASSIGN NAME = "entries_date" VALUE = "{'20'}">
<MvASSIGN NAME = "entries_author" VALUE = "{'20'}">
<MvASSIGN NAME = "time_zone" VALUE = "{'-8'}">
<MvASSIGN NAME = "show_faq" VALUE = "{'on'}">
<MvASSIGN NAME = "quote_text" VALUE = "{'on'}">
<MvASSIGN NAME = "use_time" VALUE = "{'on'}">
<MvASSIGN NAME = "show_preview" VALUE = "{'off'}">
<MvASSIGN NAME = "allow_gif" VALUE = "{'on'}">
<MvASSIGN NAME = "allow_html_body" VALUE = "{'on'}">
<MvASSIGN NAME = "allow_html_subj" VALUE = "{'on'}">
<MvASSIGN NAME = "subject_line" VALUE = "{'0'}">
<MvASSIGN NAME = "title" VALUE = "{'Message Board'}">
<MvASSIGN NAME = "title2" VALUE = "{title $ ' Admin'}">
<MvASSIGN NAME = "header" VALUE = "{''}">
<MvASSIGN NAME = "footer" VALUE ="{'</body></html>'}">
<MvASSIGN NAME = "links" VALUE = "{link_post_short $ ' ' $ link_main_short_dflt
$ ' ' $ link_search_short $ ' ' $ link_faq_short}">
<MvASSIGN NAME = "linkline" VALUE = "{'<hr width=\"90%\"\><center\>'
$ links
$ '<hr width=\"90%\"\></center\>'}">
</MvFUNCTION>
<MvCOMMENT>#################################################################
# Remove Action #
# This function is used by the options remove_by_thread, #
# remove_by_num, remove_by_date, and remove_by_author. #
# #
# Go through only those database records in the range of those #
# postings appearing on the page just displayed. If the posting #
# is marked for deletion, remove it and its tree and all associated #
# message text files, and decrement all of its ancestors' count #
# of descendents by the size of its tree + 1 (for itself). #
################################################################</MvCOMMENT>
<MvFUNCTION NAME = "Remove">
<##
<MvWHILE EXPR = "{fexists('&[dirprefix];/lockfile')}"></MvWHILE>
<MvEXPORT FILE = "&[dirprefix];/lockfile" FIELDS = "" DELIMITER = "">
##>
<MvEVAL EXPR = RemoveSetup()>
<MvASSIGN NAME = "num_no_file" VALUE = "{'0'}">
<MvASSIGN NAME = "num_not_removed" VALUE = "{'0'}">
<MvASSIGN NAME = "num_attempted" VALUE = "{'0'}">
<MvWHILE EXPR = "{NOT &[dbname];.d.eof AND dbselfnum NE super_root}">
<MvCOMMENT> If checked for removal </MvCOMMENT>
<MvEVAL EXPR = RemoveFindChecked()>
<MvIF EXPR = "{((type EQ 'remove_by_thread' OR type EQ 'remove_by_number') AND (w2 EQ 'on'))
OR (type EQ 'remove_by_date' AND w3 EQ 'on')
OR (type EQ 'remove_by_author' AND w4 EQ 'on')}"
>
<MvASSIGN NAME = "l.curr_row" VALUE = "{&[dbname];.d.recno}">
<MvASSIGN NAME = "starting_recno" VALUE = "{&[dbname];.d.recno}">
<MvASSIGN NAME = "starting_nestlvl" VALUE = "{dbnestlvl}">
<MvASSIGN NAME = "decrement_amount" VALUE = "{dbnumdesc + 1}"><MvCOMMENT> X's tree + x itself </MvCOMMENT>
<MvSETINDEX NAME = "&[dbname];" INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];"></MvSETINDEX>
<MvGO ROW = l.curr_row>
<MvEVAL EXPR = UpdateDescendentCounts()>
<MvGO ROW = l.curr_row>
<MvASSIGN NAME = "traverse_function" VALUE = "{'RemovePosting'}">
<MvEVAL EXPR = TraverseTree(parm_admin_flag,parm_user,parm_pass)>
<MvEVAL EXPR = ResetIndex()>
<MvGO ROW = l.curr_row>
</MvIF>
<MvSKIP>
</MvWHILE>
<MvCLOSE NAME = "&[dbname];">
<##
<MvASSIGN NAME = "foo" VALUE = "{fdelete('&[dirprefix];/lockfile')}">
##>
<MvEVAL EXPR = ReturnHtml2(type)>
</MvFUNCTION>
<MvFUNCTION NAME = "RemoveSetup">
<MvASSIGN NAME = "username" VALUE = "{parm_user}">
<MvASSIGN NAME = "password" VALUE = "{parm_pass}">
<MvEVAL EXPR = CheckIdentity()>
<MvASSIGN NAME = "roots_displayed_count" VALUE = "{'0'}">
<MvIF EXPR = "{type EQ 'remove_by_thread'}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];">
<MvSKIP> <MvCOMMENT> Bypass super root </MvCOMMENT>
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbseqnum LE start_seqnum AND dbseqnum GE end_seqnum AND NOT &[dbname];.d.deleted}">
<MvASSIGN NAME = "roots_per_page" VALUE = "{entries_thread}">
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_number'}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file2];,&[index_file1];,&[index_file3];">
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbselfnum GE start_item AND dbselfnum LE end_item AND NOT &[dbname];.d.deleted}">
<MvASSIGN NAME = "roots_per_page" VALUE = "{entries_msgnum}">
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_date'}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file2];,&[index_file1];,&[index_file3];">
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbselfnum GE start_self AND dbselfnum LE end_self AND NOT &[dbname];.d.deleted}">
<MvASSIGN NAME = "roots_per_page" VALUE = "{entries_date}">
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_author'}">
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file3];,&[index_file1];,&[index_file2];">
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbname1 GE start_item AND dbname1 LE end_item AND NOT &[dbname];.d.deleted}">
<MvASSIGN NAME = "roots_per_page" VALUE = "{entries_author}">
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "RemoveFindChecked">
<MvCOMMENT> If checked for removal </MvCOMMENT>
<MvASSIGN NAME = "w1" VALUE = "{'form_' $ dbselfnum}">
<MvASSIGN NAME = "w2" VALUE = "{&[w1];}">
<MvASSIGN NAME = "okdate" VALUE = "{glosub(dbdate,'/','_')}">
<MvASSIGN NAME = "w1" VALUE = "{'form_' $ okdate}">
<MvASSIGN NAME = "w3" VALUE = "{&[w1];}">
<MvASSIGN NAME = "okname" VALUE = "{glosub(dbname1,' ','_')}">
<MvASSIGN NAME = "w1" VALUE = "{'form_' $ okname}">
<MvASSIGN NAME = "w4" VALUE = "{&[w1];}">
</MvFUNCTION>
<MvFUNCTION NAME = "UpdateDescendentCounts">
<MvIF EXPR = "{dbparentno NE super_root}">
<MvASSIGN NAME = "l.parent" VALUE = "{dbparentno}">
<MvCOMMENT> Don't update super-root's count -- that affects new selfnum's </MvCOMMENT>
<MvCOMMENT> Update all ancestors' count of descendents (except super_root). </MvCOMMENT>
<MvWHILE EXPR = "{l.parent NE super_root}">
<MvSKIP ROWS = -1>
<MvIF EXPR = "{dbselfnum EQ l.parent}">
<MvASSIGN NAME = "dbnumdesc" VALUE = "{dbnumdesc - decrement_amount}">
<MvUPDATE NAME = "&[dbname];"></MvUPDATE>
<MvASSIGN NAME = "l.parent" VALUE = "{dbparentno}">
</MvIF>
</MvWHILE>
<MvELSE>
<MvCOMMENT> Update super_root parent field (= root-count). </MvCOMMENT>
<MvGO ROW = 1>
<MvASSIGN NAME = "dbparentno" VALUE = "{dbparentno - 1}">
<MvUPDATE NAME = "&[dbname];"></MvUPDATE>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "ResetIndex">
<MvIF EXPR = "{type EQ 'remove_by_thread'}">
<MvSETINDEX NAME = "&[dbname];" INDEXES = "&[index_file1];,&[index_file2];,&[index_file3];"></MvSETINDEX>
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbseqnum LE start_seqnum AND dbseqnum GE end_seqnum}">
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_number'}">
<MvSETINDEX NAME = "&[dbname];" INDEXES = "&[index_file2];,&[index_file1];,&[index_file3];"></MvSETINDEX>
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbselfnum GE start_item AND dbselfnum LE end_item}">
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_date'}">
<MvSETINDEX NAME = "&[dbname];" INDEXES = "&[index_file2];,&[index_file1];,&[index_file3];"></MvSETINDEX>
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbselfnum GE start_self AND dbselfnum LE end_self}">
<MvELSE>
<MvIF EXPR = "{type EQ 'remove_by_author'}">
<MvSETINDEX NAME = "&[dbname];" INDEXES = "&[index_file3];,&[index_file1];,&[index_file2];"></MvSETINDEX>
<MvFILTER NAME = "&[dbname];"
FILTER = "{dbname1 GE start_item AND dbname1 LE end_item}">
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "RemovePosting" PARAMETERS = "x,y,z">
<MvASSIGN NAME = "filename" VALUE = "{dirprefix $ '/' $ mesgdir $ '/' $ dbselfnum $ '.' $ ext}">
<MvASSIGN NAME = "exists" VALUE = "{fexists(filename)}">
<MvASSIGN NAME = "work_posting" VALUE = "{dbselfnum - big_bump}">
<MvCOMMENT> If posting already deleted during deletion of an ancestor, don't
try to delete it again.
<MvIF EXPR = "{exists EQ '1'}">
<MvASSIGN NAME = "deleted" VALUE = "{fdelete(filename)}">
<MvIF EXPR = "{deleted EQ '0'}">
<MvASSIGN NAME = "num_not_removed" VALUE = "{num_not_removed + 1}">
<MvASSIGN NAME = "{'not_removed' $ &[num_not_removed];}" VALUE = "{work_posting}">
</MvIF>
<MvELSE>
<MvASSIGN NAME = "num_no_file" VALUE = "{num_no_file + 1}">
<MvASSIGN NAME = "{'no_file' $ &[num_no_file];}" VALUE = "{work_posting}">
</MvIF>
</MvCOMMENT>
<MvIF EXPR = "{exists EQ '1'}">
<MvASSIGN NAME = "deleted" VALUE = "{fdelete(filename)}">
<MvASSIGN NAME = "num_attempted" VALUE = "{num_attempted + 1}">
<MvASSIGN NAME = "{'attempted' $ &[num_attempted];}" VALUE = "{work_posting}">
<MvDELETE NAME = "&[dbname];"></MvDELETE>
</MvIF>
</MvFUNCTION>
<MvFUNCTION NAME = "ProvideIdentity" PARAMETERS = "originator">
<MvASSIGN NAME = "p_user" VALUE = "{ConvertTags(p_user)}">
<MvASSIGN NAME = "p_pass1" VALUE = "{ConvertTags(p_pass1)}">
<MvASSIGN NAME = "p_pass2" VALUE = "{ConvertTags(p_pass2)}">
<MvIF EXPR = "{p_user EQ ''}">
<MvEVAL EXPR = Error2("no_name2","&[originator];")>
</MvIF>
<MvIF EXPR = "{p_pass1 EQ ''}">
<MvEVAL EXPR = Error2("empty_password2","&[originator];")>
</MvIF>
<MvIF EXPR = "{' ' CIN p_user}">
<MvEVAL EXPR = Error2("blank_in_username","&[originator];")>
<MvELSE>
<MvIF EXPR = "{' ' CIN p_pass1}">
<MvEVAL EXPR = Error2("blank_in_new_password","&[originator];")>
</MvIF>
</MvIF>
<MvIF EXPR = "{p_pass1 NE p_pass2}">
<MvEVAL EXPR = Error2("not_same2","&[originator];")>
</MvIF>
<MvASSIGN NAME = "new_passwd" VALUE = "{p_pass1 CRYPT substring(p_pass1, 1, 2)}">
<MvASSIGN NAME = "xxx" VALUE = "{fdelete(passwdfile)}">
<MvEXPORT FILE = "&[passwdfile];" FIELDS = "p_user,new_passwd" DELIMITER = ":"></MvEXPORT>
<MvCOMMENT> If admin forgot password, we delete just passwd file, they get welcome page,
they fill in info, should get admin menu --- this won't happen if action still
set to "provide_identity", so clear it now.
</MvCOMMENT>
<MvASSIGN NAME = "action" VALUE = "{''}">
</MvFUNCTION>
<MvFUNCTION NAME = "CompressDatabase" PARAMETERS = "uname,passwd">
<##
<MvWHILE EXPR = "{fexists('&[dirprefix];/lockfile')}"></MvWHILE>
<MvEXPORT FILE = "&[dirprefix];/lockfile" FIELDS = "" DELIMITER = "">
##>
<MvOPEN NAME = "&[dbname];" DATABASE = "&[database];"
INDEXES = "&[index_file2];,&[index_file1];,&[index_file3];">
<MvLOCKFILE FILE = "&[database];">
<MvLOCKFILE FILE = "&[index_file2];">
<MvLOCKFILE FILE = "&[index_file1];">
<MvLOCKFILE FILE = "&[index_file3];">
<MvPACK NAME = "&[dbname];"></MvPACK>
</MvLOCKFILE>
</MvLOCKFILE>
</MvLOCKFILE>
</MvLOCKFILE>
<MvCLOSE NAME = "&[dbname];">
<##
<MvASSIGN NAME = "foo" VALUE = "{fdelete('&[dirprefix];/lockfile')}">
##>
<MvEVAL EXPR = ChooseAdminFunction(uname,passwd)>
</MvFUNCTION>
<MvFUNCTION NAME = "ChangeUnwelcomeList" PARAMETERS = "uname,passwd">
<MvCOMMENT> Go thru list, see if ip checked (for removal), remove
(by *not* writing it back out). Otherwise, write ip out.
Check ip_address1-5 and if filled, add to list.
</MvCOMMENT>
<MvASSIGN NAME = "unwelcomelist2" VALUE = "{dirprefix $ '/' $ unwelcome_list2}">
<MvIF EXPR = "{fexists(unwelcomelist)}">
<MvIMPORT FILE = "&[unwelcomelist];" FIELDS = "ip" DELIMITER = "">
<MvASSIGN NAME = "x" VALUE = "{'form_' $ glosub(ip,'.','d')}">
<MvASSIGN NAME = "x" VALUE = "{glosub(x,'*','w')}">
<MvASSIGN NAME = "y" VALUE = "{&[x];}">
<MvIF EXPR = "{y NE 'on'}">
<MvEXPORT FILE = "&[unwelcomelist2];" FIELDS = "ip" DELIMITER = "">
</MvEXPORT>
</MvIF>
</MvIMPORT>
</MvIF>
<MvASSIGN NAME = "i" VALUE = "{1}">
<MvWHILE EXPR = "{i LT 6}">
<MvIF EXPR = "{ip_address&[i]; NE ''}">
<MvEXPORT FILE = "&[unwelcomelist2];" FIELDS = "ip_address&[i];" DELIMITER = "">
</MvEXPORT>
</MvIF>
<MvASSIGN NAME = "i" VALUE = "{i + 1}">
</MvWHILE>
<MvASSIGN NAME = "x" VALUE = "{fdelete(unwelcomelist)}">
<MvASSIGN NAME = "x" VALUE = "{frename(unwelcomelist2,unwelcomelist)}">
<MvEVAL EXPR = ShowUnwelcomeList()>
</MvFUNCTION>
<MvFUNCTION NAME = "ChangeIdentity" PARAMETERS = "originator">
<MvASSIGN NAME = "username" VALUE = "{ConvertTags(username)}">
<MvASSIGN NAME = "password" VALUE = "{ConvertTags(password)}">
<MvASSIGN NAME = "new_username" VALUE = "{ConvertTags(new_username)}">
<MvASSIGN NAME = "passwd_1" VALUE = "{ConvertTags(passwd_1)}">
<MvASSIGN NAME = "passwd_2" VALUE = "{ConvertTags(passwd_2)}">
<MvIF EXPR = "{username EQ ''}">
<MvEVAL EXPR = Error2("no_name","&[originator];")>
<MvELSE>
<MvIF EXPR = "{password EQ ''}">
<MvEVAL EXPR = Error2("empty_password2","&[originator];")>
<MvELSE>
<MvIF EXPR = "{' ' CIN new_username}">
<MvEVAL EXPR = Error2("blank_in_username","&[originator];")>
<MvELSE>
<MvIF EXPR = "{' ' CIN passwd1}">
<MvEVAL EXPR = Error2("blank_in_new_password","&[originator];")>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvIF EXPR = "{passwd_1 NE passwd_2}">
<MvEVAL EXPR = Error2("not_same","&[originator];")>
</MvIF>
<MvIMPORT FILE = "&[passwdfile];" FIELDS = "usrname,passwd" DELIMITER = ":">
</MvIMPORT>
<MvASSIGN NAME = "test_passwd" VALUE = "{password CRYPT substring(passwd, 1, 2)}">
<MvIF EXPR = "{test_passwd NE passwd}">
<MvEVAL EXPR = Error2("bad_passwd2","&[originator];")>
<MvELSE>
<MvIF EXPR = "{username NE usrname}">
<MvEVAL EXPR = Error2("bad_usrname2","&[originator];")>
<MvELSE>
<MvIF EXPR = "{passwd_1 NE ''}">
<MvASSIGN NAME = "new_passwd" VALUE = "{passwd_1 CRYPT substring(passwd, 1, 2)}">
<MvELSE>
<MvASSIGN NAME = "new_passwd" VALUE = "{test_passwd}">
</MvIF>
<MvIF EXPR = "{new_username NE ''}">
<MvASSIGN NAME = "new_usrname" VALUE = "{new_username}">
<MvIF EXPR = "{passwd_1 EQ ''}">
<MvASSIGN NAME = "passwd_1" VALUE = "{password}">
</MvIF>
<MvELSE>
<MvIF EXPR = "{passwd_1 EQ ''}">
<MvEVAL EXPR = Error2("empty_password","&[originator];")>
</MvIF>
<MvASSIGN NAME = "new_usrname" VALUE = "{usrname}">
</MvIF>
<MvASSIGN NAME = "xxx" VALUE = "{fdelete(passwdfile)}">
<MvEXPORT FILE = "&[passwdfile];" FIELDS = "new_usrname,new_passwd" DELIMITER = ":">
</MvEXPORT>
</MvIF>
</MvIF>
<MvCOMMENT> If changed or not, new_usrname has curr val </MvCOMMENT>
<MvASSIGN NAME = "parm_user" VALUE = "{new_usrname}">
<MvIF EXPR = "{passwd_1 NE ''}">
<MvASSIGN NAME = "parm_pass" VALUE = "{passwd_1}">
</MvIF>
<MvEVAL EXPR = ReturnHtml2("change_identity")>
</MvFUNCTION>
<MvFUNCTION NAME = "ChooseAdminFunction" PARAMETERS = "uname,pass">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>&[title]; Administration</h1></center>&[crlf];&[OFF];
&[ON];<hr width=90%><br>&[crlf];&[OFF];
&[ON];<UL><ul>&[crlf];&[OFF];
&[ON];<li>Change Configuration Settings&[crlf];&[OFF];
&[ON];<ul>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_change_settings+parm_user=&[uname];+parm_pass=&[pass];">Change Settings</a>&[crlf];&[OFF];
&[ON];</ul><br>&[crlf];&[OFF];
&[ON];<li>Remove Messages&[crlf];&[OFF];
&[ON];<ul>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_thread+parm_user=&[uname];+parm_pass=&[pass];">Remove Messages by Thread</a>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_num+parm_user=&[uname];+parm_pass=&[pass];">Remove Messages by Message Number</a>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_date+parm_user=&[uname];+parm_pass=&[pass];">Remove Messages by Date</a>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_author+parm_user=&[uname];+parm_pass=&[pass];">Remove Messages by Author</a>&[crlf];&[OFF];
&[ON];</ul><br>&[crlf];&[OFF];
&[ON];<li>Remove Database Records Marked for Deletion&[crlf];&[OFF];
&[ON];<ul>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_compress_database+parm_user=&[uname];+parm_pass=&[pass];">Compress Database</a>&[crlf];&[OFF];
&[ON];</ul><br>&[crlf];&[OFF];
&[ON];<li>Edit List of Unwelcome IP Addresses&[crlf];&[OFF];
&[ON];<ul>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_unwelcome_list+parm_user=&[uname];+parm_pass=&[pass];">Block IP's</a>&[crlf];&[OFF];
&[ON];</ul><br>&[crlf];&[OFF];
&[ON];<li>Change User Name or Password&[crlf];&[OFF];
&[ON];<ul>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=admin+parm_admin_func=show_change_identity+parm_user=&[uname];+parm_pass=&[pass];">Change Admin Identity</a>&[crlf];&[OFF];
&[ON];</ul><br>&[crlf];&[OFF];
&[ON];<li>View &[title];&[crlf];&[OFF];
&[ON];<ul>&[crlf];&[OFF];
&[ON];<li><a href="&[documenturl];parm_func=showmain+parm_starting_root=1+parm_admin_flag=y+parm_user=&[uname];+parm_pass=&[pass];">&[title];</a>&[crlf];&[OFF];
&[ON];</ul>&[crlf];&[OFF];
&[ON];</ul></UL>&[crlf];&[OFF];
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "ReturnHtml2" PARAMETERS = "type">
<MvIF EXPR = "{l.type EQ 'remove_by_thread'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Results of &[title]; Removal by Thread</h1></center>&[crlf];&[OFF];
<MvELSE>
<MvIF EXPR = "{l.type EQ 'remove_by_number'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Results of &[title]; Removal by Number</h1></center>&[crlf];&[OFF];
<MvELSE>
<MvIF EXPR = "{l.type EQ 'remove_by_date'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Results of &[title]; Removal by Date</h1></center>&[crlf];&[OFF];
<MvELSE>
<MvIF EXPR = "{l.type EQ 'remove_by_author'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>Results of &[title]; Removal by Author</h1></center>&[crlf];&[OFF];
<MvELSE>
<MvIF EXPR = "{l.type EQ 'change_identity'}">
&[ON];&[header];&[crlf];&[OFF];
&[ON];<center><h1>&[title]; Admin Identity Changed</h1></center>&[crlf];&[OFF];
&[ON];<ul>Your Identity for &[title]; Admin has been changed! Results are below:<p></p></ul><hr width=90%><ul><p>&[crlf];&[OFF];
&[ON];<b>User Name: &[new_usrname];</p><p>&[crlf];&[OFF];
&[ON];Password: &[passwd_1];</b></p><p>&[crlf];&[OFF];
&[ON];</ul><hr width=90%><ul></p><p>&[crlf];&[OFF];
&[ON];Do not forget these, since they are now encoded in a file and not readable!.</ul>&[crlf];&[OFF];
&[ON];<center>[ <a href="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title2];</a> ]</center></p>&[crlf];&[OFF];
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvASSIGN NAME = "work" VALUE = "{'remove' CIN l.type}">
<MvEVAL EXPR = ReturnHtml2Work()>
<MvEXIT
</MvFUNCTION>
<MvFUNCTION NAME = "ReturnHtml2Work">
<MvIF EXPR = "{work EQ '1'}">
&[ON];<blockquote>Below is a short summary of what messages were removed from the main page and the&[crlf];&[OFF];
&[ON];&[mesgdir]; directory. All files that the script attempted to remove were removed,&[crlf];&[OFF];
&[ON];unless there is an error message stating otherwise.<p></p></blockquote><hr width=90%><p>&[crlf];&[OFF];
&[ON];<blockquote><b>Messages Removed:</b>&[crlf];&[OFF];
<MvASSIGN NAME = "subscript" VALUE = "{'1'}">
<MvWHILE EXPR = "{subscript LE num_attempted}">
<MvASSIGN NAME = "w1" VALUE = "{'attempted' $ &[subscript];}">
<MvASSIGN NAME = "w2" VALUE = "{&[w1];}">
&[ON];&[w2];&[longspace];&[crlf];&[OFF];
<MvASSIGN NAME = "subscript" VALUE = "{subscript + 1}">
</MvWHILE>
&[ON];<p>&[crlf];&[OFF];
<MvIF EXPR = "{num_not_removed GT '0'}">
&[ON];<b>Messages That Could Not Be Deleted:</b>&[crlf];&[OFF];
<MvASSIGN NAME = "subscript" VALUE = "{'1'}">
<MvWHILE EXPR = "{subscript LE num_not_removed}">
<MvASSIGN NAME = "w1" VALUE = "{'not_removed' $ &[subscript];}">
<MvASSIGN NAME = "w2" VALUE = "{&[w1];}">
&[ON];&[w2];&[longspace];&[crlf];&[OFF];
<MvASSIGN NAME = "subscript" VALUE = "{subscript + 1}">
</MvWHILE>
&[ON];<p>&[crlf];&[OFF];
</MvIF>
<MvIF EXPR = "{num_no_file GT '0'}">
&[ON];<b>Messages Not Found:</b>&[crlf];&[OFF];
<MvASSIGN NAME = "subscript" VALUE = "{'1'}">
<MvWHILE EXPR = "{subscript LE num_no_file}">
<MvASSIGN NAME = "w1" VALUE = "{'no_file' $ &[subscript];}">
<MvASSIGN NAME = "w2" VALUE = "{&[w1];}">
&[ON];&[w2];&[longspace];&[crlf];&[OFF];
<MvASSIGN NAME = "subscript" VALUE = "{subscript + 1}">
</MvWHILE>
&[ON];<p>&[crlf];&[OFF];
</MvIF>
&[ON];</blockquote></p><hr width=90%><center><font size=-1>&[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_thread+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Thread</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_num+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Message Number</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_date+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Date</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=show_remove_by_author+parm_user=&[parm_user];+parm_pass=&[parm_pass];">Remove by Author</a> ] &[crlf];&[OFF];
&[ON];[ <a href="&[documenturl];parm_func=admin+parm_admin_func=null+parm_user=&[parm_user];+parm_pass=&[parm_pass];">&[title2];</a> ]&[crlf];&[OFF];
&[ON];</font></center>&[crlf];&[OFF];
&[ON];<hr width=90%>&[admin_banner_ad];&[footer];&[crlf];&[OFF];
</MvIF>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "Error2" PARAMETERS = "error,originator">
<MvIF EXPR = "{l.error EQ 'bad_passwd2'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">You entered an invalid password.&[crlf];&[OFF];
&[ON];Please try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'bad_usrname2'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">You entered an invalid user name.&[crlf];&[OFF];
&[ON];Please try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'blank_in_username'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">Blanks are not permitted in the user name.&[crlf];&[OFF];
&[ON];Please try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'blank_in_new_password'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">Blanks are not permitted in the password.&[crlf];&[OFF];
&[ON];Please try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'empty_password'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">You did not enter a new user name or password.&[crlf];&[OFF];
&[ON];Please try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'empty_password2'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">You did not enter a password. Please try again.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'passwd_file'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">Could not open the password file for reading!&[crlf];&[OFF];
&[ON];Check permissions and try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'not_same'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">The passwords that you typed in for your new password&[crlf];&[OFF];
&[ON];were not the same. You may have mistyped, please try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'not_same2'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">The two passwords you typed were not the same.&[crlf];&[OFF];
&[ON];Please try again.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'no_change'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">Could not open the password file for writing!&[crlf];&[OFF];
&[ON];Password not changed!</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'no_name'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">You did not fill in your user name.&[crlf];&[OFF];
&[ON];</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
<MvELSE>
<MvIF EXPR = "{l.error EQ 'no_name2'}">
<MvEVAL EXPR = &[originator];()>
&[ON];<center><h3><font color="#ff0000">You must fill in the user name that you want&[crlf];&[OFF];
&[ON];to use for administration.</font></h3></center><p></p>&[crlf];&[OFF];
<MvEVAL EXPR = Footer()>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
</MvIF>
<MvEXIT>
</MvFUNCTION>
<MvFUNCTION NAME = "CheckIdentity">
<MvASSIGN NAME = "username" VALUE = "{ConvertTags(username)}">
<MvASSIGN NAME = "password" VALUE = "{ConvertTags(password)}">
<MvIMPORT FILE = "&[passwdfile];" FIELDS = "usrname,passwd" DELIMITER = ":">
</MvIMPORT>
<MvIF EXPR = "{username NE usrname}">
<MvEVAL EXPR = Error2("bad_usrname2","")>
</MvIF>
<MvASSIGN NAME = "crlf" VALUE = "{asciichar(13) $ asciichar(10)}">
<MvASSIGN NAME = "test_passwd" VALUE = "{crlf IN passwd}">
<MvIF EXPR = "{test_passwd GT '0'}">
<MvASSIGN NAME = "passwd" VALUE = "{substring(passwd, 1, test_passwd-1)}">
</MvIF>
<MvASSIGN NAME = "test_passwd" VALUE = "{password CRYPT substring(passwd, 1, 2)}">
<MvIF EXPR = "{test_passwd NE passwd}">
<MvEVAL EXPR = Error2("bad_passwd2","")>
</MvIF>
</MvFUNCTION>
<MvCOMMENT>##################################################
# Subroutine used for Welcome name/password checking only. #
#################################################</MvCOMMENT>
<MvFUNCTION NAME = "CheckIdentity2" PARAMETERS = "originator">
<MvASSIGN NAME = "username" VALUE = "{ConvertTags(username)}">
<MvASSIGN NAME = "password" VALUE = "{ConvertTags(password)}">
<MvIMPORT FILE = "&[passwdfile];" FIELDS = "usrname,passwd" DELIMITER = ":">
</MvIMPORT>
<MvIF EXPR = "{username NE usrname}">
<MvEVAL EXPR = Error2("bad_usrname2","&[originator];")>
</MvIF>
<MvASSIGN NAME = "crlf" VALUE = "{asciichar(13) $ asciichar(10)}">
<MvASSIGN NAME = "test_passwd" VALUE = "{crlf IN passwd}">
<MvIF EXPR = "{test_passwd GT '0'}">
<MvASSIGN NAME = "passwd" VALUE = "{substring(passwd, 1, test_passwd-1)}">
</MvIF>
<MvASSIGN NAME = "test_passwd" VALUE = "{password CRYPT substring(passwd, 1, 2)}">
<MvIF EXPR = "{test_passwd NE passwd}">
<MvEVAL EXPR = Error2("bad_passwd2","&[originator];")>
</MvIF>
</MvFUNCTION>