home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2000-07-21 | 233.2 KB | 7,541 lines
<SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // Global variables - yuk! // ====================================================================== var currentMessage_disc; var currentUsername_disc = "Name Unset"; var currentUserFullName_disc = "Unset"; var currentUserEmailAddress_disc = "unset@unset.com"; var isAdministrator_disc = false; var config = new ASPFConfig (""); var undefined_disc; // ====================================================================== // // The TRIVIAL interface. // // These functions are the simple objects users add to their HTML docs. // They're a bit simplistic, but their trivially easy to use. // // None of them take parameters, and they directly output the object - // they don't return a string. // // ====================================================================== function FORUM_LINK_DISC () { ASPFPageElement.showForumLink (); return; } function PARENT_MESSAGE_LINK_DISC () { ASPFPageElement.showParentMessageLink (); return; } function SEARCH_FORM_DISC () { ASPFPageElement.showSearchForm (); return; } function SMALL_SEARCH_FORM_DISC () { ASPFPageElement.showSmallSearchForm (); return; } function NEW_POST_BUTTON_DISC () { ASPFPageElement.showNewPostButton (); return; } function NEW_POST_LINK_DISC () { ASPFPageElement.showNewPostLink (); return; } function NEW_REPLY_BUTTON_DISC () { ASPFPageElement.showNewReplyButton (); return; } function EDIT_POST_BUTTON_DISC () { ASPFPageElement.showEditPostButton (); return; } function ALL_ROOT_POSTS_DISC () { ASPFPageElement.showAllThreads (); return; } function ALL_ROOT_POSTS_THREADED_DISC () { ASPFPageElement.showAllThreads (); return; } function CURRENT_POSTS_THREADED_DHTML_DISC () { ASPFPageElement.showCurrentThreads (); return; } function CURRENT_ROOT_POSTS_THREADED_DISC () { ASPFPageElement.showCurrentThreads (); return; } function CURRENT_ROOT_POSTS_THREADED_STATIC_DISC () { ASPFPageElement.showCurrentThreadsStatic (); return; } function NEW_POST_FORM_DISC () { ASPFPageElement.showNewPostForm (); return; } function EDIT_POST_FORM_DISC () { ASPFPageElement.showEditPostForm (); return; } function ARCHIVE_DISC () { ASPFPageElement.showArchive (); return; } function SEARCH_RESULTS_DISC () { ASPFPageElement.actionSearch (); return; } function POST_MESSAGE_DISC () { ASPFPageElement.actionSaveNewMessage (); return; } function SAVE_EDITED_MESSAGE_DISC () { ASPFPageElement.actionSaveUpdatedMessage (); return; } function MESSAGE_DISC () { ASPFPageElement.showCurrentMessage (); return; } function THREAD_DISC () { ASPFPageElement.showCurrentThread (); return; } function ADMIN_TOOLS_DISC () { ASPFPageElement.showAdminSQLForm (); ASPFPageElement.actionExecuteAdminSQL (); return; } function STD_MESSAGE_DISC () { ASPFPageElement.showStandardMessage (); return; } function FORUM_TITLE_DISC () { ASPFPageElement.showForumTitle (); return; } function SUBJECT_DISC () { ASPFPageElement.showMessageSubject (); return; } function MESSAGE_BODY_DISC () { ASPFPageElement.showMessageBody (); return; } function AUTHOR_DISC () { ASPFPageElement.showMessageAuthorName (); return; } function AUTHOR_EMAIL_DISC () { ASPFPageElement.showMessageAuthorEmail (); return; } function AUTHOR_FULL_NAME_DISC () { ASPFPageElement.showMessageAuthorFullname (); return; } function DATE_CREATED_DISC () { ASPFPageElement.showMessageDateCreated (); return; } function DATE_MODIFIED_DISC () { ASPFPageElement.showMessageDateModified (); return; } function SORT_CODE_DISC () { ASPFPageElement.showMessageSortCode (); return; } function NUM_CHILDREN_DISC () { ASPFPageElement.showMessageNumChildren (); return; } function MESSAGE_ID_DISC () { ASPFPageElement.showMessageID (); return; } function PARENT_ID_DISC () { ASPFPageElement.showMessageParentID (); return; } function THREAD_ID_DISC () { ASPFPageElement.showMessageThreadID (); return; } function CLEANUP_DISC () { var dbase = new ASPFDatabase (); dbase.cleanup (); if (config.CACHE_PurgeOnPageCleanup) { var cache = new ASPFCache (); cache.purge (); delete cache; } delete dbase; delete config; delete currentMessage_disc; return; } //======================================================================= // // Some global helper functions. Some of these should have been built into // the language if you ask me... // //======================================================================= function isUndefined_disc (JSvariable) { var isUndefined; if ("object" == typeof (JSvariable)) { isUndefined = false; } else { isUndefined = (String (JSvariable).valueOf () == "undefined" ? true : false); } return isUndefined; } function isDefined_disc (JSvariable) { return !isUndefined_disc (JSvariable); } function safeStringDereference_disc (JSvariable) { return (isUndefined_disc (String (JSvariable)) ? "" : String (JSvariable)); } function safeNumberDereference_disc (JSvariable) { return (isUndefined_disc (JSvariable) ? "0" : JSvariable); } </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // CACHE OBJECT // // ====================================================================== function ASPFCache () { } // ====================================================================== // // Interface to private member variables. // // ====================================================================== // ====================================================================== // // Main object methods. // // ====================================================================== function retrieveObjectByKey_cch_disc (key) { var object = undefined_disc; if (config.CACHE_Enabled) { key = this.unmangleKey (key); var retrievedObject; var lastUpdated = Application (key + config.CACHE_TimeStampKey); if (isDefined_disc (lastUpdated)) { if (this.cacheObjectAlive (lastUpdated)) { object = Application (key); } } } return object; } function storeObjectByKey_cch_disc (key, object) { if (config.CACHE_Enabled) { key = this.unmangleKey (key); Application.Lock (); Application (key) = object; Application (key + config.CACHE_TimeStampKey) = (new Date ()).toLocaleString (); Application.Unlock (); } return; } function removeObjectByKey_cch_disc (key) { //Response.Write ("<H3>Removing by key: " + key + "</H3>"); if (config.CACHE_Enabled) { key = this.unmangleKey (key); this.removeObjectPrivateRoutine (key); this.removeObjectPrivateRoutine (key + config.CACHE_TimeStampKey); } return; } function removeObjectPrivateRoutine_cch_disc (unmangledkey) { Application.Lock (); if (isDefined_disc (Application (unmangledkey))) { if (typeof (Application (unmangledkey)) == "object") { //Response.Write ("<H4>Removing " + unmangledkey + "</H4>"); Application (unmangledkey).close (); } Application (unmangledkey) = undefined_disc; } Application.Unlock (); return; } function removeObjectsByKeyPrefix_cch_disc (keyPrefix) { keyPrefix = this.unmangleKey (keyPrefix); //Response.Write ("<H3>Removing by prefix: " + keyPrefix + "</H3>"); var currentKey; for (var counter = 1; counter <= Application.Contents.Count; counter++) { currentKey = Application.Contents.Key (counter); if (keyPrefix.toUpperCase () == (currentKey.substring (0, keyPrefix.length)).toUpperCase ()) { this.removeObjectPrivateRoutine (currentKey); } } return; } function purge_cch_disc () { Response.Write ("<H2>Purging</H2>"); this.removeObjectsByKeyPrefix (config.getUniqueCacheKeyPrefix ()); return; } // ====================================================================== // // Private object methods. These should not be called except by this object. // // ====================================================================== function unmangleKey_cch_disc (key) { return config.getUniqueCacheKeyPrefix () + key; } function cacheObjectAlive_cch_disc (updateTime) { var areWeAlive; var itemCachedAt = new Date (updateTime); var currentTimeStamp = new Date (); var cacheTimeout = config.ADMINSETTING_CacheTimeoutMinutes * 60 * 1000; if (((currentTimeStamp - itemCachedAt) < cacheTimeout) || (itemCachedAt.getDate () != currentTimeStamp.getDate ())) { //Response.Write ("<H2>Cached: " + (currentTimeStamp - itemCachedAt) + " is less than " + cacheTimeout + "</H2>"); areWeAlive = true; } else { //Response.Write ("<H2>Not cached: " + (currentTimeStamp - itemCachedAt) + " is greater than " + cacheTimeout + "</H2>"); areWeAlive = false; } delete itemCachedAt; delete currentTimeStamp; return areWeAlive; } ASPFCache.purge = purge_cch_disc; ASPFCache.prototype.retrieveObjectByKey = retrieveObjectByKey_cch_disc; ASPFCache.prototype.storeObjectByKey = storeObjectByKey_cch_disc; ASPFCache.prototype.removeObjectByKey = removeObjectByKey_cch_disc; ASPFCache.prototype.removeObjectPrivateRoutine = removeObjectPrivateRoutine_cch_disc; ASPFCache.prototype.removeObjectsByKeyPrefix = removeObjectsByKeyPrefix_cch_disc; ASPFCache.prototype.purge = purge_cch_disc; ASPFCache.prototype.unmangleKey = unmangleKey_cch_disc; ASPFCache.prototype.cacheObjectAlive = cacheObjectAlive_cch_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // CONFIG OBJECT // // ====================================================================== function ASPFConfig () { this.ADMINSETTING_ForumName = "Discussion Forum"; this.ADMINSETTING_DatabaseFilename = "forum.mdb"; this.ADMINSETTING_DatabaseTable = "[Forum]"; this.ADMINSETTING_DatabaseDSN = ""; this.ADMINSETTING_DaysMessagesActive = 28; this.ADMINSETTING_VirtualPath = undefined_disc; this.ADMINSETTING_CacheTimeoutMinutes = 120; this.ADMINSETTING_EmailAdminName = ""; this.ADMINSETTING_EmailAdminAddress = ""; this.ADMINSETTING_EmailAlertFromName = "ASP Forums (unknown forum) auto-alert"; this.ADMINSETTING_EmailAlertFromAddress = "asp-auto-alert@aspforums.com"; this.ADMINSETTING_EmailAlertSignature = "--\nThis message was generated by ASP Forums discussion software.\nVisit http://www.aspforums.com/ for further information."; this.ADMINSETTING_EmailAlertSignatureHTML = "<FONT FACE=\"Tahoma,Arial,Helvetica,Sans Serif\" SIZE=\"-2\"><P><HR width=\"80%\" align=\"left\"><P>This message was generated by <A HREF=\"http://www.aspforums.com/\" TITLE=\"ASP Forums web site\">ASP Forums discussion software</A>.<BR>© Copyright 1999 ASP Forums. All rights reserved. Please read our <A href=\"http://www.aspforums.com/about/privacy/\" TITLE=\"ASP Forums statement on privacy and use of personal information.\">privacy policy</A> to see how we try to protect your privacy.</P></FONT>"; // The following govern the images used for expanding and collapsing threads. this.ADMINSETTING_ExpandImagePathname = "plus.gif"; this.ADMINSETTING_ExpandImageWidth = 11; this.ADMINSETTING_ExpandImageHeight = 11; this.ADMINSETTING_CollapseImagePathname = "minus.gif"; this.ADMINSETTING_CollapseImageWidth = 11; this.ADMINSETTING_CollapseImageHeight = 11; this.ADMINSETTING_NoExpandImagePathname = "blank.gif"; this.ADMINSETTING_NoExpandImageWidth = 11; this.ADMINSETTING_NoExpandImageHeight = 11; // The following govern the images used for the formatting toolbar on the IE5 text control. this.ADMINSETTING_ToolbarBackgroundColour = "#CCCCCC"; this.ADMINSETTING_ToolbarImagePathname = "toolbar.gif"; this.ADMINSETTING_ToolbarButtonImagePathname = "button_normal.gif"; this.ADMINSETTING_ToolbarButtonImageUpPathname = "button_up.gif"; this.ADMINSETTING_ToolbarButtonImageDownPathname = "button_down.gif"; this.ADMINSETTING_ToolbarButtonImageWidth = 25; this.ADMINSETTING_ToolbarButtonImageHeight = 20; this.ADMINSETTING_ToolbarSpacerImagePathname = "toolbar_spacer.gif"; this.ADMINSETTING_ToolbarSpacerImageWidth = 5; this.ADMINSETTING_ToolbarSpacerImageHeight = 20; this.ADMINSETTING_ToolbarTotalWidth = 300; // The following govern the appearance of some page elements. this.ADMINSETTING_CSSClass = "ASPForums"; this.ADMINSETTING_CSSClassViewAuthor = "ASPForumsViewAuthor"; this.ADMINSETTING_CSSClassViewNoChildren = "ASPForumsViewNoChildren"; this.ADMINSETTING_CSSClassViewOneChild = "ASPForumsViewOneChild"; this.ADMINSETTING_CSSClassViewManyChildren = "ASPForumsViewManyChildren"; this.ADMINSETTING_CSSClassViewDate = "ASPForumsViewDate"; this.ADMINSETTING_CSSClassViewSubject = "ASPForumsViewSubject"; this.ADMINSETTING_CSSClassMsgPostedByLabel = "ASPForumsMsgPostedByLabel"; this.ADMINSETTING_CSSClassMsgPostedBy = "ASPForumsMsgPostedBy"; this.ADMINSETTING_CSSClassMsgPostedOnLabel = "ASPForumsMsgPostedOnLabel"; this.ADMINSETTING_CSSClassMsgPostedOn = "ASPForumsMsgPostedOn"; this.ADMINSETTING_CSSClassMsgBodyLabel = "ASPForumsMsgBodyLabel"; this.ADMINSETTING_CSSClassMsgBody = "ASPForumsMsgBody"; this.ADMINSETTING_CSSClassFormBody = "ASPForumsFormBody"; this.ADMINSETTING_CSSClassFormBodyLabel = "ASPForumsFormBodyLabel"; this.ADMINSETTING_CSSClassFormSubject = "ASPForumsFormSubject"; this.ADMINSETTING_CSSClassFormSubjectLabel = "ASPForumsFormSubjectLabel"; this.ADMINSETTING_CSSClassFormEmailResponses = "ASPForumsFormEmailResponses"; this.ADMINSETTING_CSSClassFormEmailResponsesLabel = "ASPForumsFormEmailResponsesLabel"; this.ADMINSETTING_CSSClassFormPostedBy = "ASPForumsFormPostedBy"; this.ADMINSETTING_CSSClassFormPostedByLabel = "ASPForumsFormPostedByLabel"; this.ADMINSETTING_CSSClassFormFullName = "ASPForumsFormFullName"; this.ADMINSETTING_CSSClassFormFullNameLabel = "ASPForumsFormFullNameLabel"; this.ADMINSETTING_CSSClassFormEmailAddress = "ASPForumsFormEmailAddress"; this.ADMINSETTING_CSSClassFormEmailAddressLabel = "ASPForumsFormEmailAddressLabel"; this.ADMINSETTING_CSSClassFormSearch = "ASPForumsFormSearch"; this.ADMINSETTING_CSSClassFormSearchSmall = "ASPForumsFormSearchSmall"; this.ADMINSETTING_CSSClassFormDateElement = "ASPForumsFormDateElement"; this.ADMINSETTING_CSSClassFormMonthElement = "ASPForumsFormMonthElement"; this.ADMINSETTING_CSSClassFormYearElement = "ASPForumsFormYearElement"; this.ADMINSETTING_TableBorderSize = 0; this.ADMINSETTING_TableFullWidth = 468; this.ADMINSETTING_TableTitleColumnWidth = 100; this.ADMINSETTING_TableFieldColumnWidth = 368; this.ADMINSETTING_TextAreaRows = 10; this.ADMINSETTING_TextAreaCols = 50; this.ADMINSETTING_PrecisLength = 150; this.ADMINSETTING_ViewIndentResponseSpaces = 8; this.ADMINSETTING_InputboxMaxLength = 100; this.ADMINSETTING_SubjectInputboxSize = 50; this.ADMINSETTING_StaticViewExpandFirstNThreads = ""; this.ADMINSETTING_StaticViewShowAtMostNRecords = 0; // The following switches turn on or off various ASP Forums features. this.ADMINSWITCH_AllowEmailResponses = true; this.ADMINSWITCH_AllowUserEditing = true; this.ADMINSWITCH_AllowRichFormatting = true; this.ADMINSWITCH_AllowRichFormattingImages = false; this.ADMINSWITCH_AllowHTMLEmail = true; this.ADMINSWITCH_ShowExpandCollapse = true; this.ADMINSWITCH_ShowEmailAddresses = true; this.ADMINSWITCH_ShowNewPostButtonOnMessage = true; this.ADMINSWITCH_ViewPostsAscending = false; this.ADMINSWITCH_ExpandAllThreads = false; // The following text strings are used on the default.asp page. this.USERTEXT_VIEW_NoMessages = "There are no messages to display."; this.USERTEXT_VIEW_NoRepliesTag = "No replies"; this.USERTEXT_VIEW_OneReplyTag = " reply"; this.USERTEXT_VIEW_ManyRepliesTag = " replies"; this.USERTEXT_VIEW_SeparateSubjectAuthor = " by "; this.USERTEXT_VIEW_SeparateAuthorDate = " on "; this.USERTEXT_VIEW_PopupExpandLink = "+ Expand this thread"; this.USERTEXT_VIEW_PopupCollapseLink = "- Collapse this thread"; // The following text strings are used on the showmessage.asp page. this.USERTEXT_SHOW_NewPostButton = "Post a new message"; this.USERTEXT_SHOW_EditPostButton = "Edit this post"; this.USERTEXT_SHOW_ReplyPostButton = "Post a reply"; this.USERTEXT_SHOW_PostedByPrompt = "Posted by:"; this.USERTEXT_SHOW_PostedOnPrompt = "Posted on:"; this.USERTEXT_SHOW_BodyPrompt = "Message:"; this.USERTEXT_SHOW_PopupSubjectPrefix = "Open message: "; this.USERTEXT_SHOW_PopupEmailPrefix = "Email: "; // The following text strings are used on the newpost.asp, newpostaction.asp, editpost and editpostaction.asp pages. this.USERTEXT_POST_UpdateFailedPrefix = "Saving failed: "; this.USERTEXT_POST_UpdateSuccessful = "Your changes have been saved."; this.USERTEXT_POST_PostFailedPrefix = "Posting failed: "; this.USERTEXT_POST_PostSuccessful = "Your message has been posted. Please do not refresh this page, since that will repost your message!"; this.USERTEXT_POST_ForumLinkPrefix = "Go back to "; this.USERTEXT_POST_ReplySubjectPrefix = "Re: "; this.USERTEXT_POST_PreviousMessageLinkText = "Go back to the previous message."; this.USERTEXT_POST_UsernamePrompt = " Username:"; this.USERTEXT_POST_FullnamePrompt = " Full Name:"; this.USERTEXT_POST_EmailAddressPrompt = " Email Address:"; this.USERTEXT_POST_PostedByPrompt = " Posted by:"; this.USERTEXT_POST_SubjectPrompt = " Subject:"; this.USERTEXT_POST_BodyPrompt = "Message:"; this.USERTEXT_POST_EmailResponsesPrompt = "Email me when someone responds to my post"; this.USERTEXT_POST_SubmitButton = "Post Message"; this.USERTEXT_POST_SaveChangesButton = "Save"; this.USERTEXT_POST_NotAuthorisedToEditMessage = "You are not authorised to edit this message."; this.USERTEXT_POST_ErrorNoSubject = "A subject is required for each post."; this.USERTEXT_POST_ErrorNoBody = "A message is required for each post."; this.USERTEXT_POST_ErrorNoUsername = "No username was supplied for posting."; this.USERTEXT_POST_ErrorNoName = "No name was supplied for posting."; this.USERTEXT_POST_ErrorNoEmail = "No email address was supplied for posting."; this.USERTEXT_POST_ErrorInvalidThreadID = "An internal error (invalid thread ID) occurred."; this.USERTEXT_POST_ErrorInvalidParentID = "An internal error (invalid parent ID) occurred."; // The following strings are all used on the archive.asp page. this.USERTEXT_ARCHIVE_ShowResults = "Show posts from that month"; // The following strings are used on the search.asp page. this.USERTEXT_SEARCH_SmallSearchPrefix = "Keyword search forum:"; this.USERTEXT_SEARCH_SubmitButton = "Search Forum"; this.USERTEXT_SEARCH_ResultsHeader1 = "Your search for "; this.USERTEXT_SEARCH_ResultsHeader2 = " found "; this.USERTEXT_SEARCH_ResultsHeaderSuffix0Match = " matches."; this.USERTEXT_SEARCH_ResultsHeaderSuffix1Match = " match."; this.USERTEXT_SEARCH_ResultsHeaderSuffixManyMatches = " matches."; // The following strings are used on the admin.asp page. this.USERTEXT_SQL_EnterPrompt = "Enter your SQL queries or updates below:" this.USERTEXT_SQL_ExecutePrompt = "Execute SQL"; this.USERTEXT_SQL_ResultsPrefix = "Results:"; this.USERTEXT_SQL_StatementPrefix = "SQL statement: "; this.USERTEXT_SQL_DBErrorPrefix = "Database errors occured:"; this.USERTEXT_SQL_DBErrorNumberPrompt = "Error Number = "; this.USERTEXT_SQL_DBErrorDescriptionPrompt = "Error description = "; this.USERTEXT_SQL_DBErrorNoErrorPrompt = "No database errors occured."; this.USERTEXT_SQL_DeleteSuccessfulMessage = "Deletion successful"; this.USERTEXT_SQL_DeleteUnsuccessfulMessage = "Deletion failed"; this.USERTEXT_SQL_DeleteHierarchyButton = "Delete Subthread From Message ID"; this.USERTEXT_SQL_PurgeCacheButton = "Purge Cache"; // The following strings are all used in email messages. this.USERTEXT_MAIL_AdminNewPostSubjectPrefix = "New Post"; this.USERTEXT_MAIL_AdminNewPostBodyPrefix = "A new message by "; this.USERTEXT_MAIL_AdminNewPostSeparateNameForum = " was posted in "; this.USERTEXT_MAIL_UserNewPostSeparateNameForum = " has responded to your post in "; this.USERTEXT_MAIL_UserNewPostSeparateNameMessage = " has responded to your message: "; this.USERTEXT_MAIL_UserNewPostNameSuffix = " has responded to your message. "; this.USERTEXT_MAIL_UserNewPostMessagePrefix = "The response reads: "; // The following are used by our general string-handling routines. this.USERTEXT_STRING_StringTruncatedSuffix = "..."; this.USERTEXT_STRING_WarningUnverifiedEmail = "WARNING: Email link created by poster. "; this.USERTEXT_STRING_WarningUnverifiedImage = "WARNING: Image embedded by poster. "; this.USERTEXT_STRING_WarningUnverifiedLink = "WARNING: URL created by poster. "; // You can rename the files involved, should you really want to. this.PAGE_AdminLocalPath = "admin.asp"; this.PAGE_ArchiveLocalPath = "archive.asp"; this.PAGE_EditPostActionLocalPath = "editpostaction.asp"; this.PAGE_EditPostLocalPath = "editpost.asp"; this.PAGE_MainLocalPath = "default.asp"; this.PAGE_MainPreferredLocalPath = "./"; this.PAGE_NewPostActionLocalPath = "newpostaction.asp"; this.PAGE_NewPostLocalPath = "newpost.asp"; this.PAGE_SearchLocalPath = "search.asp"; this.PAGE_ShowMessageLocalPath = "showmessage.asp"; this.CACHE_TimeStampKey = "Timestamp"; this.CACHE_Enabled = false; this.CACHE_PurgeOnPageCleanup = false; this.CACHE_ItemSeparator = "|"; this.CACHE_AllRootMessagesKey = "AllRoot"; this.CACHE_CurrentRootMessagesKeyPrefix = "CurrentRoot"; this.CACHE_AllCurrentMessagesKeyPrefix = "AllCurrent"; this.CACHE_RootArchivedMessagesKeyPrefix = "ArchivedRoot"; this.CACHE_AllArchivedMessagesKeyPrefix = "ArchivedAll"; this.CACHE_AllThreadMessagesKey = "AllThread"; this.CACHE_SubThreadMessagesKey = "SubThread"; this.CONST_NoError = 0; this.CONST_Error = 1; this.FORM_MessageFormName = "ASPFMessage"; this.FORM_SearchFormName = "ASPFSearch"; this.FORM_ArchiveFormName = "ASPFArchive"; this.FORM_AdminDeleteFormName = "ASPFAdminDelete"; this.FORM_AdminPurgeFormName = "ASPFAdminPurge"; this.FORM_AdminSQLFormName = "ASPFAdminSQL"; this.FORM_CheckboxChecked = " CHECKED"; this.FORM_CheckboxUnchecked = ""; this.FORM_CheckboxTrue = "Yes"; this.FORM_QueryStringMessageID = "messageID"; this.FORM_QueryStringViewExpand = "expand"; this.FORM_QueryStringViewCollapse = "collapse"; this.FORM_QueryStringViewCentre = "centreOnMessage-"; this.FORM_FieldMessageID = "messageID"; this.FORM_FieldSubject = "subject"; this.FORM_FieldMessage = "message"; this.FORM_FieldSortCode = "sortCode"; this.FORM_FieldParentID = "parentID"; this.FORM_FieldThreadID = "threadID"; this.FORM_FieldEmailResponses = "emailResponses"; this.FORM_FieldHiddenEmailOnResponse = "emailParentOnResponse"; this.FORM_FieldSearchString = "SearchString"; this.FORM_FieldUsername = "username"; this.FORM_FieldEmailaddress = "emailaddress"; this.FORM_FieldFullname = "fullname"; this.FORM_FieldSQLStatement = "SQLStatement"; this.FORM_FieldMessageIDToDelete = "messageIDToDelete"; this.FORM_FieldPurgeCache = "purgeCache"; this.FORM_FieldArchiveDate = "archiveDate"; this.FORM_FieldDateDaySuffix = "Day"; this.FORM_FieldDateMonthSuffix = "Month"; this.FORM_FieldDateYearSuffix = "Year"; this.DATABASE_MaxSortcodeSize = 25; this.DATABASE_MaxSubjectSize = 100; this.DATABASE_MaxMessageSize = 2500; this.DATABASE_MaxUsernameSize = 50; this.DATABASE_MaxFullnameSize = 50; this.DATABASE_MaxEmailAddressSize = 50; this.DATABASE_FieldMessageID = "messageID"; this.DATABASE_FieldParentID = "parent"; this.DATABASE_FieldThreadID = "threadID"; this.DATABASE_FieldSortCode = "sortCode"; this.DATABASE_FieldNumChildren = "numChildren"; this.DATABASE_FieldAuthorName = "author"; this.DATABASE_FieldAuthorFullName = "authorFullName"; this.DATABASE_FieldAuthorEmail = "authorEmail"; this.DATABASE_FieldSubject = "subject"; this.DATABASE_FieldBody = "body"; this.DATABASE_FieldEmailParentOnResponse = "emailParentOnResponse"; this.DATABASE_FieldDateCreated = "dateCreated"; this.DATABASE_FieldDateModified = "dateModified"; this.SYS_DHTMLEventHandler = "expandCollapseForumClick_disc (event); return false;"; this.SYS_AllJavascriptEvents = "onAbort|onAfterUpdate|onBeforeUnload|onBeforeUpdate|onBlur|onBounce|onClick|onChange|onDataAvailable|onDataSetChanged|onDataSetComplete|onDblClick|onDragDrop|onError|onErrorUpdate|onFilterChange|onFocus|onHelp|onKeyDown|onKeyPress|onKeyUp|onLoad|onMouseDown|onMouseMove|onMouseOut|onMouseOver|onMouseUp|onMove|onReadyStateChange|onReset|onResize|onRowEnter|onRowExit|onScroll|onSelect|onSelectStart|onStart|onSubmit|onUnload"; this.SYS_CurrentVersion = "2.0 beta 1"; this.SYS_CurrentVersionReference = "ASP Forums " + this.SYS_CurrentVersion; return this; } function getAdminPagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_AdminLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_AdminLocalPath; } return pagePath; } function getArchivePagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_ArchiveLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_ArchiveLocalPath; } return pagePath; } function getMainPagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_MainLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_MainLocalPath; } return pagePath; } function getMainPagePreferredPath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_MainPreferredLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath; } return pagePath; } function getNewPostActionPagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_NewPostActionLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_NewPostActionLocalPath; } return pagePath; } function getNewPostPagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_NewPostLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_NewPostLocalPath; } return pagePath; } function getEditPostActionPagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_EditPostActionLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_EditPostActionLocalPath; } return pagePath; } function getEditPostPagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_EditPostLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_EditPostLocalPath; } return pagePath; } function getSearchPagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_SearchLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_SearchLocalPath; } return pagePath; } function getShowMessagePagePath_cnf_disc () { var pagePath; if (isUndefined_disc (this.ADMINSETTING_VirtualPath)) { pagePath = this.PAGE_ShowMessageLocalPath; } else { pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_ShowMessageLocalPath; } return pagePath; } function getDatabaseDSN_cnf_disc () { if (this.ADMINSETTING_DatabaseDSN == "") { var DBPath = Server.MapPath (this.ADMINSETTING_DatabaseFilename); this.ADMINSETTING_DatabaseDSN = "DRIVER=Microsoft Access Driver (*.mdb);UID=admin;UserCommitSync=Yes;Threads=3;SafeTransactions=0;PageTimeout=5;MaxScanRows=8;MaxBufferSize=512;ImplicitCommitSync=Yes;FIL=MS Access;DriverId=25;DefaultDir=;DBQ=" + DBPath } return this.ADMINSETTING_DatabaseDSN; } function getSiteBaseURL_cnf_disc () { return "http://" + String (Request.ServerVariables ("HTTP_HOST")); } function getEditableUserInfoSwitch_cnf_disc () { var infoEditable; if ((currentUsername_disc == "") || (currentUserFullName_disc == "") || (currentUserEmailAddress_disc == "")) { infoEditable = true; } else { infoEditable = false; } return infoEditable; } function getUserHTMLMailPreference_cnf_disc (usernameToCheck) { return true; } function getUserEmailResponsePreference_cnf_disc (usernameToCheck) { return false; } function getUniqueCacheKeyPrefix_cnf_disc () { return this.ADMINSETTING_ForumName + this.ADMINSETTING_DatabaseTable; } function switchToForum_cnf_disc (newForumName, newForumTableName, newForumDSN, newForumFilename, newForumVirtualPath) { this.ADMINSETTING_ForumName = "Discussion Forum"; this.ADMINSETTING_DatabaseFilename = "forum.mdb"; this.ADMINSETTING_DatabaseTable = "[Forum]"; this.ADMINSETTING_DatabaseDSN = ""; this.ADMINSETTING_DaysMessagesActive = 28; this.ADMINSETTING_VirtualPath = undefined_disc; this.ADMINSETTING_CacheTimeoutMinutes = 120; if (isDefined_disc (newForumName)) { this.ADMINSETTING_ForumName = newForumName; } if (isDefined_disc (newForumTableName)) { this.ADMINSETTING_DatabaseTable = newForumTableName; } if (isDefined_disc (newForumDSN)) { this.ADMINSETTING_DatabaseDSN = newForumDSN; } if (isDefined_disc (newForumFilename)) { this.ADMINSETTING_DatabaseFilename = newForumFilename; } if (isDefined_disc (newForumVirtualPath)) { this.ADMINSETTING_VirtualPath = newForumVirtualPath; } return; } ASPFConfig.prototype.getAdminPagePath = getAdminPagePath_cnf_disc; ASPFConfig.prototype.getArchivePagePath = getArchivePagePath_cnf_disc; ASPFConfig.prototype.getEditPostActionPagePath = getEditPostActionPagePath_cnf_disc; ASPFConfig.prototype.getEditPostPagePath = getEditPostPagePath_cnf_disc; ASPFConfig.prototype.getMainPagePath = getMainPagePath_cnf_disc; ASPFConfig.prototype.getMainPagePreferredPath = getMainPagePreferredPath_cnf_disc; ASPFConfig.prototype.getNewPostActionPagePath = getNewPostActionPagePath_cnf_disc; ASPFConfig.prototype.getNewPostPagePath = getNewPostPagePath_cnf_disc; ASPFConfig.prototype.getSearchPagePath = getSearchPagePath_cnf_disc; ASPFConfig.prototype.getShowMessagePagePath = getShowMessagePagePath_cnf_disc; ASPFConfig.prototype.getEditableUserInfoSwitch = getEditableUserInfoSwitch_cnf_disc; ASPFConfig.prototype.getDatabaseDSN = getDatabaseDSN_cnf_disc; ASPFConfig.prototype.getSiteBaseURL = getSiteBaseURL_cnf_disc; ASPFConfig.prototype.getUserHTMLMailPreference = getUserHTMLMailPreference_cnf_disc; ASPFConfig.prototype.getUserEmailResponsePreference = getUserEmailResponsePreference_cnf_disc; ASPFConfig.prototype.getUniqueCacheKeyPrefix = getUniqueCacheKeyPrefix_cnf_disc; ASPFConfig.prototype.switchToForum = switchToForum_cnf_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // DATABASE OBJECT // // ====================================================================== function ASPFDatabase () { return this; } // ====================================================================== // // Interface to recordset fields (not private member variables). // // ====================================================================== function getSubjectField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldSubject)); } function getBodyField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldBody)); } function getSortCodeField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldSortCode)); } function getAuthorNameField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldAuthorName)); } function getAuthorEmailField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldAuthorEmail)); } function getAuthorFullnameField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldAuthorFullName)); } function getAuthorEmailField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldAuthorEmail)); } function getMessageIDField_db_disc (messageRecord) { return messageRecord.fields (config.DATABASE_FieldMessageID); } function getParentIDField_db_disc (messageRecord) { return messageRecord.fields (config.DATABASE_FieldParentID); } function getThreadIDField_db_disc (messageRecord) { return messageRecord.fields (config.DATABASE_FieldThreadID); } function getNumChildrenField_db_disc (messageRecord) { return messageRecord.fields (config.DATABASE_FieldNumChildren); } function getDateCreatedField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldDateCreated)); } function getDateModifiedField_db_disc (messageRecord) { return String (messageRecord.fields (config.DATABASE_FieldDateModified)); } function getEmailParentOnResponseField_db_disc (messageRecord) { return messageRecord.fields (config.DATABASE_FieldEmailParentOnResponse); } // ====================================================================== // // Main object methods. // // ====================================================================== function getAllRootMessages_db_disc (sortAscending) { var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldParentID + " = 0 ORDER BY " + config.DATABASE_FieldDateCreated; if (sortAscending) { SQLString = SQLString + " ASC"; } else { SQLString = SQLString + " DESC"; } return this.getCachedOrNewData (config.CACHE_AllRootMessagesKey, SQLString); } function getCurrentRootMessages_db_disc (sortAscending) { var cutoffDate = new Date (); cutoffDate.setDate (cutoffDate.getDate () - config.ADMINSETTING_DaysMessagesActive); var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " > {d '" + cutoffDate.getODBCNormalisedDate () + "'} AND (" + config.DATABASE_FieldParentID + " = 0 OR " + config.DATABASE_FieldParentID + " IN (SELECT " + config.DATABASE_FieldMessageID + " FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " < {d '" + cutoffDate.getODBCNormalisedDate () + "'})) ORDER BY " + config.DATABASE_FieldDateCreated; if (sortAscending) { SQLString += " ASC"; } else { SQLString += " DESC"; } delete cutoffDate; return this.getCachedOrNewData (config.CACHE_CurrentRootMessagesKeyPrefix + config.CACHE_ItemSeparator + config.ADMINSETTING_DaysMessagesActive, SQLString); } function getAllCurrentMessages_db_disc (sortAscending) { var cutoffDate = new Date (); cutoffDate.setDate (cutoffDate.getDate () - config.ADMINSETTING_DaysMessagesActive); var sortOrder; if (sortAscending) { sortOrder = " ASC"; } else { sortOrder = " DESC"; } var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " > {d '" + cutoffDate.getODBCNormalisedDate () + "'} ORDER BY " + config.DATABASE_FieldThreadID + sortOrder + ", " + config.DATABASE_FieldSortCode + " ASC"; delete cutoffDate; return this.getCachedOrNewData (config.CACHE_AllCurrentMessagesKeyPrefix + config.CACHE_ItemSeparator + config.ADMINSETTING_DaysMessagesActive, SQLString); } function getArchiveRootMessages_db_disc (archiveDate, sortAscending) { var cutoffDate = new Date (archiveDate); cutoffDate.setMonth (archiveDate.getMonth () + 1); var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " >= {d '" + archiveDate.getODBCNormalisedDate () + "'} AND " + config.DATABASE_FieldDateCreated + " < {d '" + cutoffDate.getODBCNormalisedDate () + "'} AND (" + config.DATABASE_FieldParentID + " = 0 OR " + config.DATABASE_FieldParentID + " IN (SELECT " + config.DATABASE_FieldMessageID + " FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " < {d '" + archiveDate.getODBCNormalisedDate () + "'} AND " + config.DATABASE_FieldDateCreated + " >= {d '" + cutoffDate.getODBCNormalisedDate () + "'})) ORDER BY " + config.DATABASE_FieldDateCreated; if (sortAscending) { SQLString += " ASC"; } else { SQLString += " DESC"; } delete cutoffDate; return this.getCachedOrNewData (config.CACHE_RootArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + config.ADMINSETTING_DaysMessagesActive, SQLString); } function getAllArchiveMessages_db_disc (archiveDate, sortAscending) { var cutoffDate = new Date (archiveDate); cutoffDate.setMonth (archiveDate.getMonth () + 1); var sortOrder; if (sortAscending) { sortOrder = " ASC"; } else { sortOrder = " DESC"; } var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " >= {d '" + archiveDate.getODBCNormalisedDate () + "'} AND " + config.DATABASE_FieldDateCreated + " < {d '" + cutoffDate.getODBCNormalisedDate () + "'} ORDER BY " + config.DATABASE_FieldThreadID + sortOrder + ", " + config.DATABASE_FieldSortCode + " ASC"; delete cutoffDate; return this.getCachedOrNewData (config.CACHE_AllArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + archiveDate.getYear () + config.CACHE_ItemSeparator + archiveDate.getMonth (), SQLString); } function getAllThreadMessages_db_disc (threadID) { var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldThreadID + " = " + threadID + " ORDER BY " + config.DATABASE_FieldSortCode; return this.getCachedOrNewData (config.CACHE_AllThreadMessagesKey + config.CACHE_ItemSeparator + threadID, SQLString); } function getSubThreadMessages_db_disc (threadID, startAtSortCode) { var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldThreadID + " = " + threadID + " AND " + config.DATABASE_FieldSortCode + " >= '" + startAtSortCode + "' ORDER BY " + config.DATABASE_FieldSortCode; return this.getCachedOrNewData (config.CACHE_SubThreadMessagesKey + config.CACHE_ItemSeparator + threadID + config.CACHE_ItemSeparator + startAtSortCode, SQLString); } function getMessageByID_db_disc (messageID) { var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldMessageID + " = " + messageID; return new ASPFMessage (this.executeSQL (SQLString)); } function getRecordByID_db_disc (messageID) { var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldMessageID + " = " + messageID; return this.executeSQL (SQLString); } function getRecordBySortCode_db_disc (sortCode) { var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldSortCode + " = " + sortCode; return new ASPFMessage (this.executeSQL (SQLString)); } function getRecordByDateCreated_db_disc (dateCreated) { var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " = {d '" + dateCreated.getODBCNormalisedDate () + "'}"; return new ASPFMessage (this.executeSQL (SQLString)); } function getOpenDatabaseConnection_db_disc () { var connection; if (isDefined_disc (ASPFDatabase.DBConnection)) { connection = ASPFDatabase.DBConnection; } else { connection = Server.CreateObject ("ADODB.Connection"); connection.Mode = adModeReadWrite; connection.Open (config.getDatabaseDSN ()); ASPFDatabase.DBConnection = connection; } return connection; } function getAdminSQLResults_db_disc (connection, SQLString) { return this.executeSQLUsingConnection (SQLString, connection); } function executeSQL_db_disc (SQLString) { var connection = this.getOpenDatabaseConnection (); return this.executeSQLUsingConnection (SQLString, connection); } function executeSQLUsingConnection_db_disc (SQLString, connection) { var recordSet; var command; command = Server.CreateObject ("ADODB.Command"); command.CommandText = SQLString; command.CommandType = adCmdText; recordSet = Server.CreateObject ("ADODB.RecordSet"); //Response.Write ("<H5>" + SQLString + "</H5>"); //Response.Write ("<pre>" + executeSQLUsingConnection_db_disc.caller + "</pre>"); recordSet.Open (SQLString, connection, adOpenKeyset, adLockOptimistic, adCmdText); delete command; return recordSet; } function searchForum_db_disc (stringToSearchFor) { var searchString; searchString = String (stringToSearchFor).replace (/\'/gi, ASPFHTML.DOUBLE_QUOTES ()); var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldBody + " LIKE '%" + searchString + "%' OR " + config.DATABASE_FieldSubject + " LIKE '%" + searchString + "%' OR " + config.DATABASE_FieldAuthorName + " LIKE '%" + searchString + "%' OR " + config.DATABASE_FieldAuthorEmail + " LIKE '%" + searchString + "%' OR " + config.DATABASE_FieldAuthorFullName + " LIKE '%" + searchString + "%' ORDER BY " + config.DATABASE_FieldDateCreated + " DESC"; return this.executeSQL (SQLString); } function saveNewRecord_db_disc (message) { var postedDate = new Date(); var connection = this.getOpenDatabaseConnection (); this.beginTransaction (); message.setSortCode (this.getNewSortCode (message.parentID)); message.setDateCreated (postedDate); message.setDateModified (postedDate); var newMessageRecord = Server.CreateObject ("ADODB.RecordSet"); newMessageRecord.Open (config.ADMINSETTING_DatabaseTable, connection, adOpenKeyset, adLockPessimistic, adCmdTable); newMessageRecord.AddNew (); newMessageRecord.Fields (config.DATABASE_FieldDateCreated) = postedDate.getODBCNormalisedTimeStamp (); newMessageRecord.Fields (config.DATABASE_FieldDateModified) = postedDate.getODBCNormalisedTimeStamp (); newMessageRecord.Fields (config.DATABASE_FieldParentID) = message.getParentID (); newMessageRecord.Fields (config.DATABASE_FieldNumChildren) = 0; newMessageRecord.Fields (config.DATABASE_FieldSortCode) = message.getSortCode (); newMessageRecord.Fields (config.DATABASE_FieldThreadID) = message.getThreadID (); newMessageRecord.Fields (config.DATABASE_FieldAuthorName) = message.getAuthorName (); newMessageRecord.Fields (config.DATABASE_FieldAuthorFullName) = message.getAuthorFullname (); newMessageRecord.Fields (config.DATABASE_FieldAuthorEmail) = message.getAuthorEmail (); newMessageRecord.Fields (config.DATABASE_FieldEmailParentOnResponse) = ((message.getEmailParentOnResponse () == true) ? "True" : "False"); newMessageRecord.Fields (config.DATABASE_FieldSubject) = message.getSubject (); newMessageRecord.Fields (config.DATABASE_FieldBody) = message.getBody (); newMessageRecord.Update (); var newMessage = new ASPFMessage (newMessageRecord); message.setMessageID (newMessage.getMessageID ()); if (isUndefined_disc (message.getThreadID ()) || (message.getThreadID () == 0)) { message.setThreadID (newMessage.getMessageID ()); } if (newMessage.getSortCode () == "0") { var SQLString = "UPDATE " + config.ADMINSETTING_DatabaseTable + " SET " + config.DATABASE_FieldThreadID + " = " + newMessage.getMessageID () + ", " + config.DATABASE_FieldSortCode + " = str(" + newMessage.getMessageID () + ") WHERE " + config.DATABASE_FieldMessageID + " = " + newMessage.getMessageID (); this.executeSQLUsingConnection (SQLString, connection); } if (connection.Errors.Count == 0) { this.commitTransaction (); } else { this.rollbackTransaction (); } this.expireCurrentCache (); this.expireThreadCache (newMessage.getThreadID ()); this.expireArchiveCache (postedDate); connection = ""; newMessageRecord.Close (); delete postedDate; delete newMessageRecord; delete newMessage; return newMessage.getMessageID (); } function saveUpdatedRecord_db_disc (message) { var modifiedDate = new Date(); message.setDateModified (modifiedDate); var connection = this.getOpenDatabaseConnection (); this.beginTransaction (); var messageRecord = this.getRecordByID (message.getMessageID ()); var newNumChildren; void message.getNumChildren (); void messageRecord.Fields (config.DATABASE_FieldNumChildren); if (message.getNumChildren () > messageRecord.Fields (config.DATABASE_FieldNumChildren)) { newNumChildren = message.getNumChildren (); } else { newNumChildren = messageRecord.Fields (config.DATABASE_FieldNumChildren); } messageRecord.Fields (config.DATABASE_FieldDateModified) = modifiedDate.getODBCNormalisedTimeStamp (); messageRecord.Fields (config.DATABASE_FieldNumChildren) = newNumChildren; messageRecord.Fields (config.DATABASE_FieldAuthorName) = message.getAuthorName (); messageRecord.Fields (config.DATABASE_FieldAuthorFullName) = message.getAuthorFullname (); messageRecord.Fields (config.DATABASE_FieldAuthorEmail) = message.getAuthorEmail (); messageRecord.Fields (config.DATABASE_FieldEmailParentOnResponse) = ((message.getEmailParentOnResponse () == true) ? "True" : "False"); messageRecord.Fields (config.DATABASE_FieldSubject) = message.getSubject (); messageRecord.Fields (config.DATABASE_FieldBody) = message.getBody (); if (message.getEmailParentOnResponse () == true) { } messageRecord.Update (); if (connection.Errors.Count == 0) { this.commitTransaction (); } else { this.rollbackTransaction (); } this.expireCurrentCache (); this.expireThreadCache (message.getThreadID ()); this.expireArchiveCache (modifiedDate); connection = ""; messageRecord.Close (); delete messageRecord; delete modifiedDate; return; } function getNewSortCode_db_disc (parentID) { var newSortCode; if (parentID == 0) { newSortCode = "0"; } else { var parentMessage = this.getMessageByID (parentID); parentMessage.setNumChildren (parentMessage.getNumChildren () + 1); newSortCode = parentMessage.getSortCode () + "." + parentMessage.getNumChildren (); parentMessage.saveUpdatedData (); delete parentMessage; } return newSortCode; } function deleteMessage_db_disc (connection, messageID) { var messageToDelete = this.getMessageByID (messageID); var parentID = messageToDelete.getParentID (); if (messageToDelete.getNumChildren () > 0) { var threadSQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldThreadID + " = " + messageToDelete.getThreadID () + " AND " + config.DATABASE_FieldSortCode + " LIKE '" + messageToDelete.getSortCode () + "%' ORDER BY " + config.DATABASE_FieldSortCode; var children = this.executeSQLUsingConnection (threadSQLString, connection); while (!children.EOF) { children.Delete(); children.MoveNext(); } delete children; } var SQLString = "DELETE FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldMessageID + " = " + messageID; this.executeSQLUsingConnection (SQLString, connection); delete messageToDelete; return; } function decrementNumChildren_db_disc (connection, parentID) { if (parentID != 0) { var parentMessage = this.getMessageByID (parentID); var SQLString = "UPDATE " + config.ADMINSETTING_DatabaseTable + " SET " + config.DATABASE_FieldNumChildren + "=" + (parentMessage.getNumChildren () - 1) + " WHERE " + config.DATABASE_FieldMessageID + " = " + parentID; this.executeSQLUsingConnection (SQLString, connection); delete parentMessage; } return; } function getConnectionErrors_db_disc (connection) { var errorOutput = ""; if (connection.errors.count > 0) { errorOutput += config.USERTEXT_SQL_DBErrorPrefix; var counter; for (counter = 0; counter < connection.errors.count; counter++) { errorOutput += config.USERTEXT_SQL_DBErrorNumberPrompt; errorOutput += connection.errors(counter).number + "\n"; errorOutput += config.USERTEXT_SQL_DBErrorDescriptionPrompt; errorOutput += connection.errors(counter).description + "\n"; } } else { errorOutput += config.USERTEXT_SQL_DBErrorNoErrorPrompt; } return errorOutput; } function deleteMessageHierarchy_db_disc (messageID) { var connection = this.getOpenDatabaseConnection (); this.beginTransaction (); var messageToDelete = this.getMessageByID (messageID); var parentID = messageToDelete.getParentID (); var returnedMessage = ""; this.deleteMessage (connection, messageID); this.decrementNumChildren (connection, parentID); if (connection.Errors.Count == 0) { returnedMessage = config.USERTEXT_SQL_DeleteSuccessfulMessage.strong (); this.commitTransaction (); } else { returnedMessage = config.USERTEXT_SQL_DeleteUnsuccessfulMessage.strong (); this.rollbackTransaction (); } delete messageToDelete; return returnedMessage; } function beginTransaction_db_disc () { if (ASPFDatabase.DBTransactionLevel == 0) { var connection = this.getOpenDatabaseConnection (); connection.BeginTrans (); connection = ""; } ASPFDatabase.DBTransactionLevel++; return; } function commitTransaction_db_disc () { if (ASPFDatabase.DBTransactionLevel == 1) { var connection = this.getOpenDatabaseConnection (); connection.CommitTrans (); connection = ""; } ASPFDatabase.DBTransactionLevel--; return; } function rollbackTransaction_db_disc () { var connection = this.getOpenDatabaseConnection (); connection.RollbackTrans (); connection = ""; ASPFDatabase.DBTransactionLevel = 0; return; } function isInTransation_db_disc () { var isInTransaction; if (ASPFDatabase.DBTransactionLevel > 0) { isInTransaction = true; } else { isInTransaction = false; } return isInTransation; } function getCachedOrNewData_db_disc (itemKey, SQLString) { var newData; var cache = new ASPFCache (); var cachedData = cache.retrieveObjectByKey (itemKey); if (isUndefined_disc (cachedData)) { //Response.Write ("<H2>Retrieving new information</H2>"); newData = this.executeSQL (SQLString); cache.storeObjectByKey (itemKey, newData); } else { //Response.Write ("<H2>Using cached information</H2>"); newData = cachedData; if (newData.RecordCount > 0) { newData.MoveFirst (); } } delete cache; return newData; } function expireThreadCache_db_disc (threadID) { //Response.Write ("<H2>Expiring thread cache for " + threadID + "</H2>"); var cache = new ASPFCache (); cache.removeObjectByKey (config.CACHE_AllThreadMessagesKey + config.CACHE_ItemSeparator + threadID); cache.removeObjectsByKeyPrefix (config.CACHE_SubThreadMessagesKey + config.CACHE_ItemSeparator + threadID); delete cache; return; } function expireCurrentCache_db_disc () { //Response.Write ("<H2>Expiring current cache</H2>"); var cache = new ASPFCache (); cache.removeObjectByKey (config.CACHE_AllRootMessagesKey); cache.removeObjectsByKeyPrefix (config.CACHE_AllCurrentMessagesKeyPrefix); cache.removeObjectsByKeyPrefix (config.CACHE_CurrentRootMessagesKeyPrefix); delete cache; return; } function expireArchiveCache_db_disc (archiveDate) { if (isDefined_disc (archiveDate)) { var cache = new ASPFCache (); cache.removeObjectByKey (config.CACHE_AllArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + archiveDate.getYear () + config.CACHE_ItemSeparator + archiveDate.getMonth ()); cache.removeObjectByKey (config.CACHE_RootArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + archiveDate.getYear () + config.CACHE_ItemSeparator + archiveDate.getMonth ()); delete cache; } return; } function cleanup_db_disc () { if (isDefined_disc (ASPFDatabase.DBConnection)) { delete ASPFDatabase.DBConnection; } return; } ASPFDatabase.DBConnection = undefined_disc; ASPFDatabase.DBTransactionLevel = 0; ASPFDatabase.prototype.getSubjectField = getSubjectField_db_disc; ASPFDatabase.prototype.getBodyField = getBodyField_db_disc; ASPFDatabase.prototype.getSortCodeField = getSortCodeField_db_disc; ASPFDatabase.prototype.getAuthorNameField = getAuthorNameField_db_disc; ASPFDatabase.prototype.getAuthorEmailField = getAuthorEmailField_db_disc; ASPFDatabase.prototype.getAuthorFullnameField = getAuthorFullnameField_db_disc; ASPFDatabase.prototype.getAuthorEmailField = getAuthorEmailField_db_disc; ASPFDatabase.prototype.getMessageIDField = getMessageIDField_db_disc; ASPFDatabase.prototype.getParentIDField = getParentIDField_db_disc; ASPFDatabase.prototype.getThreadIDField = getThreadIDField_db_disc; ASPFDatabase.prototype.getNumChildrenField = getNumChildrenField_db_disc; ASPFDatabase.prototype.getDateCreatedField = getDateCreatedField_db_disc; ASPFDatabase.prototype.getDateModifiedField = getDateModifiedField_db_disc; ASPFDatabase.prototype.getEmailParentOnResponseField = getEmailParentOnResponseField_db_disc; ASPFDatabase.prototype.getAllRootMessages = getAllRootMessages_db_disc; ASPFDatabase.prototype.getCurrentRootMessages = getCurrentRootMessages_db_disc; ASPFDatabase.prototype.getAllCurrentMessages = getAllCurrentMessages_db_disc; ASPFDatabase.prototype.getArchiveRootMessages = getArchiveRootMessages_db_disc; ASPFDatabase.prototype.getAllArchiveMessages = getAllArchiveMessages_db_disc; ASPFDatabase.prototype.getAllThreadMessages = getAllThreadMessages_db_disc; ASPFDatabase.prototype.getSubThreadMessages = getSubThreadMessages_db_disc; ASPFDatabase.prototype.getMessageByID = getMessageByID_db_disc; ASPFDatabase.prototype.getRecordByID = getRecordByID_db_disc; ASPFDatabase.prototype.getRecordBySortCode = getRecordBySortCode_db_disc; ASPFDatabase.prototype.getRecordByDateCreated = getRecordByDateCreated_db_disc; ASPFDatabase.prototype.getOpenDatabaseConnection = getOpenDatabaseConnection_db_disc; ASPFDatabase.prototype.getAdminSQLResults = getAdminSQLResults_db_disc; ASPFDatabase.prototype.executeSQL = executeSQL_db_disc; ASPFDatabase.prototype.executeSQLUsingConnection = executeSQLUsingConnection_db_disc; ASPFDatabase.prototype.getNewSortCode = getNewSortCode_db_disc; ASPFDatabase.prototype.deleteMessage = deleteMessage_db_disc; ASPFDatabase.prototype.decrementNumChildren = decrementNumChildren_db_disc; ASPFDatabase.prototype.getConnectionErrors = getConnectionErrors_db_disc; ASPFDatabase.prototype.deleteMessageHierarchy = deleteMessageHierarchy_db_disc; ASPFDatabase.prototype.searchForum = searchForum_db_disc; ASPFDatabase.prototype.saveNewRecord = saveNewRecord_db_disc; ASPFDatabase.prototype.saveUpdatedRecord = saveUpdatedRecord_db_disc; ASPFDatabase.prototype.beginTransaction = beginTransaction_db_disc; ASPFDatabase.prototype.commitTransaction = commitTransaction_db_disc; ASPFDatabase.prototype.rollbackTransaction = rollbackTransaction_db_disc; ASPFDatabase.prototype.isInTransation = isInTransation_db_disc; ASPFDatabase.prototype.getCachedOrNewData = getCachedOrNewData_db_disc; ASPFDatabase.prototype.expireThreadCache = expireThreadCache_db_disc; ASPFDatabase.prototype.expireCurrentCache = expireCurrentCache_db_disc; ASPFDatabase.prototype.expireArchiveCache = expireArchiveCache_db_disc; ASPFDatabase.prototype.cleanup = cleanup_db_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // DATE OBJECT ADDITIONS // // ====================================================================== function getODBCNormalisedDate_date_disc () { var yearString; var monthString; var dayString; yearString = this.getFullYear (); monthString = this.getMonth () + 1; if (monthString < 10) { monthString = "0" + monthString; } dayString = this.getDate (); if (dayString < 10) { dayString = "0" + dayString; } return yearString + "-" + monthString + "-" + dayString; } function getODBCNormalisedTime_date_disc () { var normalisedTime = ""; if (this.getHours () >= 10) { normalisedTime += this.getHours (); } else { normalisedTime += "0" + this.getHours (); } normalisedTime += ":"; if (this.getMinutes () >= 10) { normalisedTime += this.getMinutes (); } else { normalisedTime += "0" + this.getMinutes (); } normalisedTime += ":"; if (this.getSeconds () >= 10) { normalisedTime += this.getSeconds (); } else { normalisedTime += "0" + this.getSeconds (); } return normalisedTime; } function getODBCNormalisedTimeStamp_date_disc () { return this.getODBCNormalisedDate () + " " + this.getODBCNormalisedTime (); } function getMonthName_date_disc (index) { return this.getMonthNameByIndex (this.getMonth ()); } function getDayName_date_disc (index) { return this.getDayNameByIndex (this.getDay ()); } function getDateSuffix_date_disc (index) { return this.getDateSuffixByIndex (this.getDate ()); } function getMonthNameByIndex_date_disc (index) { var monthName; switch (index) { case 0: monthName = "January"; break; case 1: monthName = "February"; break; case 2: monthName = "March"; break; case 3: monthName = "April"; break; case 4: monthName = "May"; break; case 5: monthName = "June"; break; case 6: monthName = "July"; break; case 7: monthName = "August"; break; case 8: monthName = "September"; break; case 9: monthName = "October"; break; case 10: monthName = "November"; break; case 11: monthName = "December"; break; default: monthName = "Error"; break; } return monthName; } function getDayNameByIndex_date_disc (index) { var dayName; switch (index) { case 0: dayName = "Sunday"; break; case 1: dayName = "Monday"; break; case 2: dayName = "Tuesday"; break; case 3: dayName = "Wednesday"; break; case 4: dayName = "Thursday"; break; case 5: dayName = "Friday"; break; case 6: dayName = "Saturday"; break; default: dayName = "Error"; break; } return dayName; } function getDateSuffixByIndex_date_disc (index) { var dateSuffix; switch (index) { case 1: case 21: case 31: dateSuffix = "st"; break; case 2: case 22: dateSuffix = "nd"; break; case 3: case 23: dateSuffix = "rd"; break; case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: dateSuffix = "th"; break; case 0: default: dateSuffix = "Error"; break; } return dateSuffix; } function getShortFormat_date_disc () { var HTMLout = this.getDayName () + ", " + this.getDate() + this.getDateSuffix() + " " + this.getMonthName () + " " + this.getFullYear(); delete dateValue; return HTMLout; } function getLongFormat_date_disc () { var HTMLout = this.getDayName () + ", " + this.getDate () + this.getDateSuffix () + " " + this.getMonthName () + " " + this.getFullYear(); return HTMLout; } Date.getMonthNameByIndex = getMonthNameByIndex_date_disc; Date.getDayNameByIndex = getDayNameByIndex_date_disc; Date.getDateSuffixByIndex = getDateSuffixByIndex_date_disc; Date.prototype.getODBCNormalisedDate = getODBCNormalisedDate_date_disc; Date.prototype.getODBCNormalisedTime = getODBCNormalisedTime_date_disc; Date.prototype.getODBCNormalisedTimeStamp = getODBCNormalisedTimeStamp_date_disc; Date.prototype.getMonthName = getMonthName_date_disc; Date.prototype.getDayName = getDayName_date_disc; Date.prototype.getDateSuffix = getDateSuffix_date_disc; Date.prototype.getMonthNameByIndex = getMonthNameByIndex_date_disc; Date.prototype.getDayNameByIndex = getDayNameByIndex_date_disc; Date.prototype.getDateSuffixByIndex = getDateSuffixByIndex_date_disc; Date.prototype.getShortFormat = getShortFormat_date_disc; Date.prototype.getLongFormat = getLongFormat_date_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // EMAIL OBJECT // // ====================================================================== function ASPFEmail () { this.toName = ""; this.toAddress = ""; this.fromName = ""; this.fromAddress = ""; this.subject = ""; this.body = ""; return this; } // ====================================================================== // // Interface to private member variables. // // ====================================================================== function getToName_eml_disc () { return this.toName; } function setToName_eml_disc (newToName) { this.toName = newToName; return; } function getToAddress_eml_disc () { return this.toAddress; } function setToAddress_eml_disc (newToAddress) { this.toAddress = newToAddress; return; } function getFromName_eml_disc () { return this.fromName; } function setFromName_eml_disc (newFromName) { this.fromName = newFromName; return; } function getFromAddress_eml_disc () { return this.fromAddress; } function setFromAddress_eml_disc (newFromAddress) { this.fromAddress = newFromAddress; return; } function getSubject_eml_disc () { return this.subject; } function setSubject_eml_disc (newSubject) { this.subject = newSubject; return; } function getBody_eml_disc () { return this.body; } function setBody_eml_disc (newBody) { this.toBody = newBody; return; } // ====================================================================== // // Main object methods. // // ====================================================================== function getFromEmailLink_eml_disc () { var HTMLout; if (config.ADMINSWITCH_ShowEmailAddresses) { HTMLout = A_open_html_disc ("mailto:" + this.fromAddress, config.USERTEXT_SHOW_PopupEmailPrefix + this.fromName + " (" + this.fromAddress + ")"); HTMLout += this.fromName; HTMLout += ASPFHTML.A_close (); } else { HTMLout = this.fromName; } return HTMLout; } function getHTMLMessageBody_eml_disc (message, title, bodyText, signature) { var messageBody = ""; messageBody += ASPFHTML.DTD (); messageBody += ASPFHTML.HTML_open (); messageBody += ASPFHTML.BODY_open ("#FFFFFF", undefined_disc, "#0000FF", "#FF0000", "#660066"); messageBody += ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, undefined_disc, undefined_disc, undefined_disc, 0, 0); messageBody += ASPFHTML.TR_open (); messageBody += ASPFHTML.TD_open (140, undefined_disc, "#99CCFF"); messageBody += ASPFHTML.DIV_open (undefined_disc, undefined_disc, "center"); messageBody += ASPFHTML.A_open ("http://www.aspforums.com/"); messageBody += ASPFHTML.IMG ("http://www.aspforums.com/images/logo.gif", "ASP Forums", 0, 120, 56); messageBody += ASPFHTML.A_close (); messageBody += ASPFHTML.DIV_close (); messageBody += ASPFHTML.TD_close (); messageBody += ASPFHTML.TD_open (468, undefined_disc, "#336699"); messageBody += ASPFHTML.FONT_open (5, "Tahoma", "#FFFFFF"); messageBody += ASPFHTML.NBSP (); messageBody += title; messageBody += ASPFHTML.FONT_close (); messageBody += ASPFHTML.TD_close (); messageBody += ASPFHTML.TR_close (); messageBody += ASPFHTML.TR_open (); messageBody += ASPFHTML.TD_open (140); messageBody += ASPFHTML.NBSP (); messageBody += ASPFHTML.TD_close (); messageBody += ASPFHTML.TD_open (config.ADMINSETTING_TableFullWidth); messageBody += ASPFHTML.P_open (); messageBody += ASPFHTML.NBSP (); messageBody += ASPFHTML.P_close (); messageBody += ASPFHTML.FONT_open (-1, "Tahoma"); messageBody += bodyText; messageBody += ASPFHTML.FONT_close (); messageBody += ASPFHTML.TD_close (); messageBody += ASPFHTML.TR_close (); messageBody += ASPFHTML.TR_open (); messageBody += ASPFHTML.TD_open (140); messageBody += ASPFHTML.NBSP (); messageBody += ASPFHTML.TD_close (); messageBody += ASPFHTML.TD_open (config.ADMINSETTING_TableFullWidth); messageBody += signature; messageBody += ASPFHTML.P_open (); messageBody += ASPFHTML.NBSP (); messageBody += ASPFHTML.P_close (); messageBody += ASPFHTML.FONT_close (); messageBody += ASPFHTML.TD_close (); messageBody += ASPFHTML.TR_close (); messageBody += ASPFHTML.TABLE_close (); return messageBody; } function sendHTML_eml_disc () { var From = this.fromName + " <" + this.fromAddress + ">"; var To = this.toAddress; sendHTMLMailMessage_eml_disc (To, From, this.subject, this.body, config.getSiteBaseURL ()); } function send_eml_disc () { var From = this.fromName + " <" + this.fromAddress + ">"; var To = this.toAddress; sendRegularMailMessage_eml_disc (To, From, this.subject, this.body); } ASPFEmail.prototype.getFromEmailLink = getFromEmailLink_eml_disc; ASPFEmail.prototype.getHTMLMessageBody = getHTMLMessageBody_eml_disc; ASPFEmail.prototype.sendHTML = sendHTML_eml_disc; ASPFEmail.prototype.send = send_eml_disc; </SCRIPT> <SCRIPT LANGUAGE="VBScript" RUNAT="Server"> ' Has to be in VBScript for the error recovery. Sub sendRegularMailMessage_eml_disc (messageTo, messageFrom, messageSubject, messageBody) On Error Resume Next Dim mailMessage Set mailMessage = Server.CreateObject ("CDONTS.NewMail") if Not mailMessage is Nothing then mailMessage.From = messageFrom mailMessage.To = messageTo mailMessage.Subject = messageSubject mailMessage.Body = messageBody mailMessage.Send Set mailMessage = Nothing end if End Sub Sub sendHTMLMailMessage_eml_disc (messageTo, messageFrom, messageSubject, messageBody, baseURL) On Error Resume Next Dim mailMessage Set mailMessage = Server.CreateObject ("CDONTS.NewMail") if Not mailMessage is Nothing then mailMessage.From = messageFrom mailMessage.To = messageTo mailMessage.Subject = messageSubject mailMessage.Body = messageBody mailMessage.ContentBase = baseURL mailMessage.BodyFormat = 0 mailMessage.MailFormat = 0 mailMessage.Send Set mailMessage = Nothing end if End Sub </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // EXPANDCOLLAPSE OBJECT // // ====================================================================== function ASPFExpandCollapse (message, viewIndex, currentThreadID, activeThreadID, pageURLToUse) { this.message = message; this.viewIndex = viewIndex; this.currentThreadID = currentThreadID; this.activeThreadID = activeThreadID; this.QueryString = ""; if (isUndefined_disc (pageURLToUse)) { this.pageURLToUse = config.getMainPagePath (); } else { this.pageURLToUse = pageURLToUse; } return this; } // ====================================================================== // // Interface to private member variables. // // ====================================================================== function getMessage_exp_disc () { return this.message; } function setMessage_exp_disc (newMessage) { this.message = newMessage; return; } function getViewIndex_exp_disc () { return this.viewIndex; } function setViewIndex_exp_disc (newViewIndex) { this.viewIndex = newViewIndex; return; } function getCurrentThreadID_exp_disc () { return this.currentThreadID; } function setCurrentThreadID_exp_disc (newCurrentThreadID) { this.currentThreadID = newCurrentThreadID; return; } function getActiveThreadID_exp_disc () { return this.activeThreadID; } function setActiveThreadID_exp_disc (newActiveThreadID) { this.activeThreadID = newActiveThreadID; return; } function getQueryString_exp_disc () { return this.QueryString; } function setQueryString_exp_disc (newQueryString) { this.QueryString = newQueryString; return; } // ====================================================================== // // Main object methods. // // ====================================================================== function getIcon_exp_disc () { var toggle = ""; if (config.ADMINSWITCH_ShowExpandCollapse) { if (0 == this.message.getNumChildren ()) { toggle = this.getNoExpandToggle(); } else { if (((this.currentThreadID == this.activeThreadID) || (this.viewIndex <= config.ADMINSETTING_StaticViewExpandFirstNThreads)) && !(this.doWeCollapse())) { toggle = this.getCollapseToggle(); } else { toggle = this.getExpandToggle(); } } } return toggle; } function getDHTMLIcon_exp_disc (currentIndentLevel) { var toggle; if (0 == this.message.getNumChildren ()) { toggle = ASPFHTML.IMG (config.ADMINSETTING_NoExpandImagePathname, " ", 0, config.ADMINSETTING_NoExpandImageWidth, config.ADMINSETTING_NoExpandImageHeight, this.message.getMessageID (), this.message.getMessageID (), config.SYS_DHTMLEventHandler) + ASPFHTML.NBSP (); } else { if (currentIndentLevel == 1) { toggle = this.getExpandLinkTag () + ASPFHTML.IMG (config.ADMINSETTING_ExpandImagePathname, config.USERTEXT_VIEW_PopupExpandLink, 0, config.ADMINSETTING_ExpandImageWidth, config.ADMINSETTING_ExpandImageHeight, this.message.getMessageID (), this.message.getMessageID (), config.SYS_DHTMLEventHandler) + ASPFHTML.A_close () + ASPFHTML.NBSP (); } else { toggle = this.getCollapseLinkTag () + ASPFHTML.IMG (config.ADMINSETTING_CollapseImagePathname, config.USERTEXT_VIEW_PopupCollapseLink, 0, config.ADMINSETTING_CollapseImageWidth, config.ADMINSETTING_CollapseImageHeight, this.message.getMessageID (), this.message.getMessageID (), config.SYS_DHTMLEventHandler) + ASPFHTML.A_close () + ASPFHTML.NBSP (); } } return toggle; } function getNoExpandToggle_exp_disc () { return ASPFHTML.IMG (config.ADMINSETTING_NoExpandImagePathname, " ", 0, config.ADMINSETTING_NoExpandImageWidth, config.ADMINSETTING_NoExpandImageHeight, this.message.getMessageID (), this.message.getMessageID (), "") + ASPFHTML.NBSP (); } function getExpandLinkTag_exp_disc () { return ASPFHTML.A_open (this.getExpandURL () + "#" + config.FORM_QueryStringViewCentre + "-" + this.message.getMessageID (), config.USERTEXT_VIEW_PopupExpandLink, config.FORM_QueryStringViewCentre + "-" + this.message.getMessageID (), config.defaultTarget, config.FORM_QueryStringViewCentre + "-" + this.message.getMessageID ()); } function getExpandToggle_exp_disc () { return this.getExpandLinkTag () + ASPFHTML.IMG (config.ADMINSETTING_ExpandImagePathname, config.USERTEXT_VIEW_PopupExpandLink, 0, config.ADMINSETTING_ExpandImageWidth, config.ADMINSETTING_ExpandImageHeight, this.message.getMessageID (), this.message.getMessageID (), "") + ASPFHTML.A_close () + ASPFHTML.NBSP (); } function getCollapseLinkTag_exp_disc () { return ASPFHTML.A_open (this.getCollapseURL () + "#" + config.FORM_QueryStringViewCentre + "-" + this.message.getMessageID (), config.USERTEXT_VIEW_PopupCollapseLink, config.FORM_QueryStringViewCentre + "-" + this.message.getMessageID (), config.defaultTarget, config.FORM_QueryStringViewCentre + "-" + this.message.getMessageID ()); } function getCollapseToggle_exp_disc () { return this.getCollapseLinkTag () + ASPFHTML.IMG (config.ADMINSETTING_CollapseImagePathname, config.USERTEXT_VIEW_PopupCollapseLink, 0, config.ADMINSETTING_CollapseImageWidth, config.ADMINSETTING_CollapseImageHeight, this.message.getMessageID (), this.message.getMessageID (), "") + ASPFHTML.A_close () + ASPFHTML.NBSP (); } function getExpandURL_exp_disc () { var URL = this.pageURLToUse; var URLToUse = ""; if (this.stripThisIDFromQString()) { URLToUse = (this.queryString == "" ? config.getMainPagePreferredPath () : URL + "?" + this.queryString); } else { URLToUse = URL + "?" + config.FORM_QueryStringViewExpand + "=" + this.message.getMessageID () + (this.queryString == "" ? "" : "&" + this.queryString); } return URLToUse; } function getCollapseURL_exp_disc () { var URL = this.pageURLToUse; var URLToUse = ""; if (this.stripThisIDFromQString()) { URLToUse = (this.queryString == "" ? config.getMainPagePreferredPath () : URL + "?" + this.queryString); } else { URLToUse = URL + "?" + config.FORM_QueryStringViewCollapse + "=" + this.message.getMessageID () + (this.queryString == "" ? "" : "&" + this.queryString); } return URLToUse; } function stripThisIDFromQString_exp_disc () { var IDRemoved = false; var QString = ""; var item; var numitems; numitems = Request.QueryString (config.FORM_QueryStringViewExpand).count; for (item = 1; item <= numitems; item++) { if (Request.QueryString (config.FORM_QueryStringViewExpand)(item) == this.message.getMessageID ()) { IDRemoved = true; } else { QString += config.FORM_QueryStringViewExpand + "=" + Server.URLEncode (Request.QueryString (config.FORM_QueryStringViewExpand)(item)) + "&"; } } numitems = Request.QueryString (config.FORM_QueryStringViewCollapse).count; for (item = 1; item <= numitems; item++) { if (Request.QueryString (config.FORM_QueryStringViewCollapse)(item) == this.message.getMessageID ()) { IDRemoved = true; } else { QString += config.FORM_QueryStringViewCollapse + "=" + Server.URLEncode (Request.QueryString (config.FORM_QueryStringViewCollapse)(item)) + "&"; } } numitems = Request.QueryString.count; for (item = 1; item <= numitems; item++) { if ((Request.QueryString.Key (item) != config.FORM_QueryStringViewCollapse) && (Request.QueryString.Key (item) != config.FORM_QueryStringViewExpand) && (Request.QueryString.Key (item) != config.FORM_QueryStringViewCentre)) { QString += Request.QueryString.Key (item) + "=" + Request.QueryString (item) + "&"; } } this.queryString = QString.substr(0, QString.length - 1); return IDRemoved; } function doWeExpand_exp_disc () { var expand = false; var item; var numitems; var doExpand = false; if (config.ADMINSWITCH_ExpandAllThreads) { doExpand = true; } else { if (this.viewIndex <= config.ADMINSETTING_StaticViewExpandFirstNThreads) { doExpand = true; } else { numitems = Request.QueryString (config.FORM_QueryStringViewExpand).count; for (item = 1; item <= numitems; item++) { if (Request.QueryString (config.FORM_QueryStringViewExpand)(item) == this.message.getMessageID ()) { expand = true; } } doExpand = expand; } } return doExpand; } function doWeCollapse_exp_disc () { var collapse = false; var item; var numitems; numitems = Request.QueryString (config.FORM_QueryStringViewCollapse).count; for (item = 1; item <= numitems; item++) { if (Request.QueryString (config.FORM_QueryStringViewCollapse)(item) == this.message.getMessageID ()) { collapse = true; } } return collapse; } ASPFExpandCollapse.prototype.getMessage = getMessage_exp_disc; ASPFExpandCollapse.prototype.setMessage = setMessage_exp_disc; ASPFExpandCollapse.prototype.getViewIndex = getViewIndex_exp_disc; ASPFExpandCollapse.prototype.setViewIndex = setViewIndex_exp_disc; ASPFExpandCollapse.prototype.getCurrentThreadID = getCurrentThreadID_exp_disc; ASPFExpandCollapse.prototype.setCurrentThreadID = setCurrentThreadID_exp_disc; ASPFExpandCollapse.prototype.getActiveThreadID = getActiveThreadID_exp_disc; ASPFExpandCollapse.prototype.setActiveThreadID = setActiveThreadID_exp_disc; ASPFExpandCollapse.prototype.getQueryString = getQueryString_exp_disc; ASPFExpandCollapse.prototype.setQueryString = setQueryString_exp_disc; ASPFExpandCollapse.prototype.getIcon = getIcon_exp_disc; ASPFExpandCollapse.prototype.getDHTMLIcon = getDHTMLIcon_exp_disc; ASPFExpandCollapse.prototype.getNoExpandToggle = getNoExpandToggle_exp_disc; ASPFExpandCollapse.prototype.getExpandLinkTag = getExpandLinkTag_exp_disc; ASPFExpandCollapse.prototype.getExpandToggle = getExpandToggle_exp_disc; ASPFExpandCollapse.prototype.getCollapseLinkTag = getCollapseLinkTag_exp_disc; ASPFExpandCollapse.prototype.getCollapseToggle = getCollapseToggle_exp_disc; ASPFExpandCollapse.prototype.getExpandURL = getExpandURL_exp_disc; ASPFExpandCollapse.prototype.getCollapseURL = getCollapseURL_exp_disc; ASPFExpandCollapse.prototype.stripThisIDFromQString = stripThisIDFromQString_exp_disc; ASPFExpandCollapse.prototype.doWeExpand = doWeExpand_exp_disc; ASPFExpandCollapse.prototype.doWeCollapse = doWeCollapse_exp_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // FORM OBJECT // // ====================================================================== function ASPFForm (formData) { this.setAllFields (formData); return this; } // ====================================================================== // // Interface to private member variables. // // ====================================================================== function getMessageID_frm_disc () { return this.messageID; } function setMessageID_frm_disc (newMessageID) { this.messageID = newMessageID; return; } function getSubject_frm_disc () { return this.subject; } function setSubject_frm_disc (newSubject) { this.subject = newSubject; return; } function getBody_frm_disc () { return this.body; } function setBody_frm_disc (newBody) { this.body = newBody; return; } function getSortCode_frm_disc () { return this.sortCode; } function setSortCode_frm_disc (newSortCode) { this.sortCode = newSortCode; return; } function getParentID_frm_disc () { return this.parentID; } function setParentID_frm_disc (newParentID) { this.parentID = newParentID; return; } function getThreadID_frm_disc () { return this.threadID; } function setThreadID_frm_disc (newThreadID) { this.threadID = newThreadID; return; } function getEmailParentOnResponse_frm_disc () { return this.emailParentOnResponse; } function setEmailParentOnResponse_frm_disc (newEmailParentOnResponse) { this.emailParentOnResponse = newEmailParentOnResponse; return; } function getSearchString_frm_disc () { return this.searchString; } function setSearchString_frm_disc (newSearchString) { this.searchString = newSearchString; return; } function getSQLStatement_frm_disc () { return this.SQLStatement; } function setSQLStatement_frm_disc (newSQLStatement) { this.SQLStatement = newSQLStatement; return; } function getMessageIDToDelete_frm_disc () { return this.messageIDToDelete; } function setMessageIDToDelete_frm_disc (newMessageIDToDelete) { this.messageIDToDelete = newMessageIDToDelete; return; } function getSwitchEditableUserInfo_frm_disc () { return this.switchEditableUserInfo; } function setSwitchEditableUserInfo_frm_disc (newSwitchEditableUserInfo) { this.switchEditableUserInfo = newSwitchEditableUserInfo; return; } function getAuthorName_frm_disc () { return this.authorName; } function setAuthorName_frm_disc (newAuthorName) { this.authorName = newAuthorName; return; } function getAuthorEmail_frm_disc () { return this.authorEmail; } function setAuthorEmail_frm_disc (newAuthorEmail) { this.authorEmail = newAuthorEmail; return; } function getAuthorFullname_frm_disc () { return this.authorFullname; } function setAuthorFullname_frm_disc (newAuthorFullname) { this.authorFullname = newAuthorFullname; return; } function getArchiveDate_frm_disc () { return this.archiveDate; } function setArchiveDate_frm_disc (newArchiveDate) { this.archiveDate = newArchiveDate; return; } // ====================================================================== // // Main object methods. // // ====================================================================== function setAllFields_frm_disc (newForm) { if (newForm instanceof ASPFMessage) { this.setAllFieldsFromMessage (newForm); } else if (newForm != null) { this.setAllFieldsFromForm (newForm); } else { this.setAllFieldsEmpty (); } return; } function setAllFieldsFromMessage_frm_disc (message) { this.subject = message.getSubject (); this.body = message.getBody (); this.sortCode = message.getSortCode (); this.parentID = message.getParentID (); this.threadID = message.getThreadID (); this.messageID = message.getMessageID (); this.emailParentOnResponse = message.getEmailParentOnResponse (); this.searchString = ""; this.SQLStatement = ""; this.switchEditableUserInfo = config.getEditableUserInfoSwitch (); if (this.switchEditableUserInfo) { this.authorName = message.authorName; this.authorEmail = message.authorEmail; this.authorFullname = message.authorFullname; } else { this.authorName = currentUsername_disc; this.authorEmail = currentUserEmailAddress_disc; this.authorFullname = currentUserFullName_disc; } return; } function setAllFieldsFromForm_frm_disc (formData) { this.messageID = safeStringDereference_disc (formData (config.FORM_FieldMessageID)); this.subject = safeStringDereference_disc (formData (config.FORM_FieldSubject)); this.body = safeStringDereference_disc (ASPFTextControl.getControlContents (formData, config.FORM_FieldMessage)); this.sortCode = safeStringDereference_disc (formData (config.FORM_FieldSortCode)); this.parentID = safeStringDereference_disc (formData (config.FORM_FieldParentID)); this.threadID = safeStringDereference_disc (formData (config.FORM_FieldThreadID)); this.emailParentOnResponse = (isUndefined_disc (formData (config.FORM_FieldEmailResponses)) ? config.getUserEmailResponsePreference (currentUsername_disc) : (formData (config.FORM_FieldEmailResponses) == config.FORM_CheckboxTrue ? true : false)); this.searchString = safeStringDereference_disc (formData (config.FORM_FieldSearchString)); this.SQLStatement = safeStringDereference_disc (formData (config.FORM_FieldSQLStatement)); this.messageIDToDelete = safeStringDereference_disc (formData (config.FORM_FieldMessageIDToDelete)); this.switchEditableUserInfo = config.getEditableUserInfoSwitch (); this.archiveDate = this.interpretMonthYearSubform (formData, config.FORM_FieldArchiveDate); this.purgeCache = (safeStringDereference_disc (formData (config.FORM_FieldPurgeCache)) == config.FORM_CheckboxTrue ? true : false); if (this.switchEditableUserInfo) { this.authorName = safeStringDereference_disc (formData (config.FORM_FieldUsername)); this.authorEmail = safeStringDereference_disc (formData (config.FORM_FieldEmailaddress)); this.authorFullname = safeStringDereference_disc (formData (config.FORM_FieldFullname)); } else { this.authorName = currentUsername_disc; this.authorEmail = currentUserEmailAddress_disc; this.authorFullname = currentUserFullName_disc; } return; } function setAllFieldsEmpty_frm_disc () { this.subject = ""; this.body = ""; this.sortCode = ""; this.parentID = ""; this.threadID = ""; this.messageID = ""; this.emailParentOnResponse = false; this.searchString = ""; this.messageIDToDelete = ""; this.SQLStatement = ""; this.switchEditableUserInfo = config.getEditableUserInfoSwitch (); this.archiveDate = undefined_disc; this.purgeCache = false; if (this.switchEditableUserInfo) { this.authorName = this (config.FORM_FieldUsername); this.authorEmail = this (config.FORM_FieldEmailaddress); this.authorFullname = this (config.FORM_FieldFullname); } else { this.authorName = currentUsername_disc; this.authorEmail = currentUserEmailAddress_disc; this.authorFullname = currentUserFullName_disc; } return; } function getSubjectInputField_frm_disc () { var subject = this.subject; return ASPFHTML.INPUT_text (config.FORM_FieldSubject, subject, config.ADMINSETTING_SubjectInputboxSize); } function getBodyInputField_frm_disc () { var body = String (this.body); var textcontrol = new ASPFTextControl (config.FORM_FieldMessage, body, this.formName); var HTMLout = textcontrol.getControl (); return HTMLout; } function getSubjectSubform_frm_disc () { var HTMLout = ""; HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSubjectLabel); HTMLout += config.USERTEXT_POST_SubjectPrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSubject); HTMLout += this.getSubjectInputField (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); return HTMLout; } function getBodySubform_frm_disc () { var HTMLout = ""; HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormBodyLabel); HTMLout += (ASPFHTML.NBSP () + config.USERTEXT_POST_BodyPrompt).weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.BR (); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormBody); HTMLout += this.getBodyInputField (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); return HTMLout; } function getEmailResponsesSubform_frm_disc () { var emailResponsesChecked; if ((this.emailParentOnResponse == true) || (this.emailParentOnResponse == config.FORM_CheckboxTrue)) { emailResponsesChecked = config.FORM_CheckboxChecked; } else { emailResponsesChecked = config.FORM_CheckboxUnchecked; } var HTMLout = ""; if (config.ADMINSWITCH_AllowEmailResponses) { HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2); HTMLout += ASPFHTML.P_open (); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailResponses); HTMLout += ASPFHTML.INPUT_checkbox (config.FORM_FieldEmailResponses, config.FORM_CheckboxTrue, emailResponsesChecked); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailResponsesLabel); HTMLout += config.USERTEXT_POST_EmailResponsesPrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.P_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); } return HTMLout; } function getNonEditableUserInfoSubform_frm_disc () { var HTMLout = ""; var username; username = this.authorName.weak () + (" (" + ASPFHTML.QUOTE_open () + this.authorFullname + ASPFHTML.QUOTE_close () + ", " + this.authorEmail + ")").weak (); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedByLabel); HTMLout += config.USERTEXT_POST_PostedByPrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedBy); HTMLout += username.strong (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); return HTMLout; } function getEditableUserInfoSubform_frm_disc () { var HTMLout = ""; HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedByLabel); HTMLout += config.USERTEXT_POST_PostedByPrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedBy); HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldUsername, this.authorName, 25, 50); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormFullNameLabel); HTMLout += config.USERTEXT_POST_FullnamePrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormFullName); HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldFullname, this.authorFullname, 25, 50); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailAddressLabel); HTMLout += config.USERTEXT_POST_EmailAddressPrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailAddress); HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldEmailaddress, this.authorEmail, 25, 50); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); return HTMLout; } function getUserInfoSubform_frm_disc () { var userInfoSubform = ""; if (this.switchEditableUserInfo) { userInfoSubform = this.getEditableUserInfoSubform (); } else { userInfoSubform = this.getNonEditableUserInfoSubform (); } return userInfoSubform; } function getDateSubform_frm_disc (fieldValue, fieldname, startYear, endYear) { var HTMLout = ""; if (isUndefined_disc (fieldValue)) { fieldValue = new Date (); } else { fieldValue = new Date (fieldValue); } HTMLout += this.getDateElement (fieldname, fieldValue.getDate ()); HTMLout += this.getMonthElement (fieldname, fieldValue.getMonth ()); HTMLout += this.getYearElement (fieldname, fieldValue.getFullYear (), startYear, endYear); return HTMLout; } function getMonthYearSubform_frm_disc (fieldValue, fieldname, startYear, endYear) { var HTMLout = ""; if (isUndefined_disc (fieldValue)) { fieldValue = new Date (); } else { fieldValue = new Date (fieldValue); } HTMLout += this.getMonthElement (fieldname, fieldValue.getMonth ()); HTMLout += this.getYearElement (fieldname, fieldValue.getFullYear (), startYear, endYear); return HTMLout; } function getMessageForm_frm_disc (actionPath, buttonLabel) { this.formName = config.FORM_MessageFormName var HTMLout = ASPFHTML.FORM_open (actionPath, undefined_disc, this.formName); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldMessageID, this.messageID); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldParentID, this.parentID); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldThreadID, this.threadID); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldSortCode, this.sortCode); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldHiddenEmailOnResponse, this.emailParentOnResponse); HTMLout += ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, config.ADMINSETTING_TableFullWidth, undefined_disc, undefined_disc, 0, 0); HTMLout += this.getUserInfoSubform (); HTMLout += this.getSubjectSubform (); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2); HTMLout += ASPFHTML.NBSP (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += this.getBodySubform (); HTMLout += this.getEmailResponsesSubform (); HTMLout += ASPFHTML.TR_open () + ASPFHTML.TD_open (config.ADMINSETTING_TableFullWidth, undefined_disc, undefined_disc, undefined_disc, "bottom", 2); HTMLout += ASPFHTML.INPUT_submit (buttonLabel, buttonLabel) + ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TABLE_close (); HTMLout += ASPFHTML.FORM_close (); return HTMLout; } function getSearchForm_frm_disc (label) { this.formName = config.FORM_SearchFormName; var HTMLout = ASPFHTML.FORM_open (config.getSearchPagePath (), undefined_disc, this.formName); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSearch); HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldSearchString, this.searchString, "25"); HTMLout += ASPFHTML.INPUT_submit (label, label); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.FORM_close (); return HTMLout; } function getSmallSearchForm_frm_disc (label) { this.formName = config.FORM_SearchFormName; var HTMLout = ASPFHTML.FORM_open (config.getSearchPagePath (), undefined_disc, this.forumName); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSearchSmall); HTMLout += label.weakSmall (); HTMLout += ASPFHTML.BR (); HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldSearchString, this.searchString, "10"); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.FORM_close (); return HTMLout; } function getArchiveSelector_frm_disc () { this.forumName = config.FORM_ArchiveFormName; var HTMLout = ASPFHTML.FORM_open (config.getArchivePagePath (), "get", this.forumName); HTMLout += this.getMonthYearSubform (this.archiveDate, config.FORM_FieldArchiveDate, 1999, 2001); HTMLout += ASPFHTML.INPUT_submit (undefined_disc, config.USERTEXT_ARCHIVE_ShowResults); HTMLout += ASPFHTML.FORM_close (); return HTMLout; } function getAdminForm_frm_disc () { this.forumName = config.FORM_AdminDeleteFormName; var adminForm = ASPFHTML.FORM_open (config.getAdminPagePath (), undefined_disc, this.forumName); adminForm += ASPFHTML.INPUT_submit (config.USERTEXT_SQL_DeleteHierarchyButton, config.USERTEXT_SQL_DeleteHierarchyButton); adminForm += ASPFHTML.NBSP (); adminForm += ASPFHTML.INPUT_text (config.FORM_FieldMessageIDToDelete, "", 10); adminForm += ASPFHTML.FORM_close (); this.forumName = config.FORM_AdminPurgeFormName; adminForm += ASPFHTML.FORM_open (config.getAdminPagePath (), undefined_disc, this.forumName); adminForm += ASPFHTML.INPUT_hidden (config.FORM_FieldPurgeCache, config.FORM_CheckboxTrue); adminForm += ASPFHTML.INPUT_submit (config.USERTEXT_SQL_PurgeCacheButton, config.USERTEXT_SQL_PurgeCacheButton); adminForm += ASPFHTML.FORM_close (); this.forumName = config.FORM_AdminSQLFormName; adminForm += ASPFHTML.FORM_open (config.getAdminPagePath (), undefined_disc, this.forumName); adminForm += ASPFHTML.TEXTAREA_open (config.FORM_FieldSQLStatement, config.ADMINSETTING_TextAreaCols, config.ADMINSETTING_TextAreaRows); adminForm += this.SQLStatement; adminForm += ASPFHTML.TEXTAREA_close () + ASPFHTML.BR (); adminForm += ASPFHTML.INPUT_submit (config.USERTEXT_SQL_ExecutePrompt, config.USERTEXT_SQL_ExecutePrompt); adminForm += ASPFHTML.FORM_close (); return adminForm; } function getDateElement_frm_disc (fieldname, fieldValue) { var HTMLout = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormDateElement); HTMLout += ASPFHTML.SELECT_open (fieldname + config.FORM_FieldDateDaySuffix); for (var counter = 1; counter < 32; counter++) { HTMLout += ASPFHTML.OPTION (counter, (counter == fieldValue)); HTMLout += counter + Date.getDateSuffixByIndex (counter); } HTMLout += ASPFHTML.SELECT_close (); HTMLout += ASPFHTML.SPAN_close (); return HTMLout; } function getMonthElement_frm_disc (fieldname, fieldValue) { var HTMLout = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormMonthElement); HTMLout += ASPFHTML.SELECT_open (fieldname + config.FORM_FieldDateMonthSuffix); for (var counter = 0; counter < 12; counter++) { HTMLout += ASPFHTML.OPTION (counter, (counter == fieldValue)); HTMLout += Date.getMonthNameByIndex (counter); } HTMLout += ASPFHTML.SELECT_close (); HTMLout += ASPFHTML.SPAN_close (); return HTMLout; } function getYearElement_frm_disc (fieldname, fieldValue, startYear, endYear) { var HTMLout = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormYearElement); HTMLout += ASPFHTML.SELECT_open (fieldname + config.FORM_FieldDateYearSuffix); for (var counter = startYear; counter < (endYear + 1); counter++) { HTMLout += ASPFHTML.OPTION (counter, (counter == fieldValue)); HTMLout += counter; } HTMLout += ASPFHTML.SELECT_close (); HTMLout += ASPFHTML.SPAN_close (); return HTMLout; } function interpretDateSubform_frm_disc (form, fieldName) { var fieldDate; if (isDefined_disc (form (fieldName + config.FORM_FieldDateMonthSuffix))) { var dateValue = safeNumberDereference_disc (form (fieldName + config.FORM_FieldDateDaySuffix)); var monthValue = safeNumberDereference_disc (form (fieldName + config.FORM_FieldDateMonthSuffix)); var yearValue = safeNumberDereference_disc (form (fieldName + config.FORM_FieldDateYearSuffix)); fieldDate = new Date (); fieldDate.setDate (dateValue); fieldDate.setMonth (monthValue); fieldDate.setYear (yearValue); } return fieldDate; } function interpretMonthYearSubform_frm_disc (form, fieldName) { var fieldDate; if (isDefined_disc (String (form (fieldName + config.FORM_FieldDateMonthSuffix)))) { var monthValue = safeNumberDereference_disc (String (form (fieldName + config.FORM_FieldDateMonthSuffix))); var yearValue = safeNumberDereference_disc (String (form (fieldName + config.FORM_FieldDateYearSuffix))); fieldDate = new Date (); fieldDate.setDate (1); fieldDate.setMonth (monthValue); fieldDate.setYear (yearValue); } return fieldDate; } ASPFForm.prototype.getMessageID = getMessageID_frm_disc; ASPFForm.prototype.setMessageID = setMessageID_frm_disc; ASPFForm.prototype.getSubject = getSubject_frm_disc; ASPFForm.prototype.setSubject = setSubject_frm_disc; ASPFForm.prototype.getBody = getBody_frm_disc; ASPFForm.prototype.setBody = setBody_frm_disc; ASPFForm.prototype.getSortCode = getSortCode_frm_disc; ASPFForm.prototype.setSortCode = setSortCode_frm_disc; ASPFForm.prototype.getParentID = getParentID_frm_disc; ASPFForm.prototype.setParentID = setParentID_frm_disc; ASPFForm.prototype.getThreadID = getThreadID_frm_disc; ASPFForm.prototype.setThreadID = setThreadID_frm_disc; ASPFForm.prototype.getEmailParentOnResponse = getEmailParentOnResponse_frm_disc; ASPFForm.prototype.setEmailParentOnResponse = setEmailParentOnResponse_frm_disc; ASPFForm.prototype.getSearchString = getSearchString_frm_disc; ASPFForm.prototype.setSearchString = setSearchString_frm_disc; ASPFForm.prototype.getSQLStatement = getSQLStatement_frm_disc; ASPFForm.prototype.setSQLStatement = setSQLStatement_frm_disc; ASPFForm.prototype.getMessageIDToDelete = getMessageIDToDelete_frm_disc; ASPFForm.prototype.setMessageIDToDelete = setMessageIDToDelete_frm_disc; ASPFForm.prototype.getSwitchEditableUserInfo = getSwitchEditableUserInfo_frm_disc; ASPFForm.prototype.setSwitchEditableUserInfo = setSwitchEditableUserInfo_frm_disc; ASPFForm.prototype.getAuthorName = getAuthorName_frm_disc; ASPFForm.prototype.setAuthorName = setAuthorName_frm_disc; ASPFForm.prototype.getAuthorEmail = getAuthorEmail_frm_disc; ASPFForm.prototype.setAuthorEmail = setAuthorEmail_frm_disc; ASPFForm.prototype.getAuthorFullname = getAuthorFullname_frm_disc; ASPFForm.prototype.setAuthorFullname = setAuthorFullname_frm_disc; ASPFForm.prototype.getArchiveDate = getArchiveDate_frm_disc; ASPFForm.prototype.setArchiveDate = setArchiveDate_frm_disc; ASPFForm.prototype.setAllFields = setAllFields_frm_disc; ASPFForm.prototype.setAllFieldsFromForm = setAllFieldsFromForm_frm_disc; ASPFForm.prototype.setAllFieldsFromMessage = setAllFieldsFromMessage_frm_disc; ASPFForm.prototype.setAllFieldsEmpty = setAllFieldsEmpty_frm_disc; ASPFForm.prototype.getSubjectInputField = getSubjectInputField_frm_disc; ASPFForm.prototype.getBodyInputField = getBodyInputField_frm_disc; ASPFForm.prototype.getSubjectSubform = getSubjectSubform_frm_disc; ASPFForm.prototype.getBodySubform = getBodySubform_frm_disc; ASPFForm.prototype.getEmailResponsesSubform = getEmailResponsesSubform_frm_disc; ASPFForm.prototype.getNonEditableUserInfoSubform = getNonEditableUserInfoSubform_frm_disc; ASPFForm.prototype.getEditableUserInfoSubform = getEditableUserInfoSubform_frm_disc; ASPFForm.prototype.getDateSubform = getDateSubform_frm_disc; ASPFForm.prototype.getMonthYearSubform = getMonthYearSubform_frm_disc; ASPFForm.prototype.getUserInfoSubform = getUserInfoSubform_frm_disc; ASPFForm.prototype.getMessageForm = getMessageForm_frm_disc; ASPFForm.prototype.getSearchForm = getSearchForm_frm_disc; ASPFForm.prototype.getSmallSearchForm = getSmallSearchForm_frm_disc; ASPFForm.prototype.getArchiveSelector = getArchiveSelector_frm_disc; ASPFForm.prototype.getAdminForm = getAdminForm_frm_disc; ASPFForm.prototype.getDateElement = getDateElement_frm_disc; ASPFForm.prototype.getMonthElement = getMonthElement_frm_disc; ASPFForm.prototype.getYearElement = getYearElement_frm_disc; ASPFForm.prototype.interpretDateSubform = interpretDateSubform_frm_disc; ASPFForm.prototype.interpretMonthYearSubform = interpretMonthYearSubform_frm_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // HTML OBJECT // // ====================================================================== function ASPFHTML (tagString) { this.tagSource = tagString; return this; } function A_open_html_disc (linkURL_mand, linkTitle, linkName, linkTarget, linkID) { var HTMLout = "<A HREF=\"" + linkURL_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (linkTitle)) { HTMLout += " TITLE=\"" + linkTitle + "\""; } if (isDefined_disc (linkName)) { HTMLout += " NAME=\"" + linkName + "\""; } if (isDefined_disc (linkTarget)) { HTMLout += " TARGET=\"" + linkTarget + "\""; } if (isDefined_disc (linkID)) { HTMLout += " ID=\"" + linkID + "\""; } HTMLout += ">"; return HTMLout; } function A_close_html_disc () { return "</A>"; } function BASE_html_disc (HREF_mand) { return "<BASE HREF=\"" + HREF_mand + "\">"; } function BLOCKQUOTE_open_html_disc () { return "<BLOCKQUOTE CLASS=\"" + config.ADMINSETTING_CSSClass + "\">"; } function BLOCKQUOTE_close_html_disc () { return "</BLOCKQUOTE>"; } function BODY_open_html_disc (backgroundColour, backgroundImage, normalLinkColour, activeLinkColour, visitedLinkColour, topMargin, leftMargin, marginHeight, marginWidth) { var HTMLout = "<BODY CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (backgroundColour)) { HTMLout += " BGCOLOR=\"" + backgroundColour + "\""; } if (isDefined_disc (backgroundImage)) { HTMLout += " BACKGROUND=\"" + backgroundImage + "\""; } if (isDefined_disc (normalLinkColour)) { HTMLout += " LINK=\"" + normalLinkColour + "\""; } if (isDefined_disc (activeLinkColour)) { HTMLout += " ALINK=\"" + activeLinkColour + "\""; } if (isDefined_disc (visitedLinkColour)) { HTMLout += " VLINK=\"" + visitedLinkColour + "\""; } if (isDefined_disc (topMargin)) { HTMLout += " TOPMARGIN=\"" + topMargin + "\""; } if (isDefined_disc (leftMargin)) { HTMLout += " LEFTMARGIN=\"" + leftMargin + "\""; } if (isDefined_disc (marginHeight)) { HTMLout += " MARGINHEIGHT=\"" + marginHeight + "\""; } if (isDefined_disc (marginWidth)) { HTMLout += " MARGINWIDTH=\"" + marginWidth + "\""; } HTMLout += ">"; return HTMLout; } function BODY_close_html_disc () { return "</BODY>"; } function BR_html_disc () { return "<BR CLASS=\"" + config.ADMINSETTING_CSSClass + "\" />"; } function DIV_open_html_disc (ID, style, alignment) { var HTMLout = "<DIV CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (ID)) { HTMLout += " ID=\"" + ID + "\""; } if (isDefined_disc (style)) { HTMLout += " STYLE=\"" + style + "\""; } if (isDefined_disc (alignment)) { HTMLout += " ALIGN=\"" + alignment + "\""; } HTMLout += ">"; return HTMLout; } function DIV_close_html_disc () { return "</DIV>"; } function DOUBLE_QUOTES_html_disc () { return """; } function DTD_html_disc () { return "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"; } function FONT_open_html_disc (size, face, colour, style) { var HTMLout = "<FONT"; if (isDefined_disc (size)) { HTMLout += " SIZE=\"" + size + "\""; } if (isDefined_disc (face)) { HTMLout += " FACE=\"" + face + "\""; } if (isDefined_disc (colour)) { HTMLout += " COLOR=\"" + colour + "\""; } if (isDefined_disc (style)) { HTMLout += " STYLE=\"" + style + "\""; } HTMLout += ">"; return HTMLout; } function FONT_close_html_disc () { return "</FONT>"; } function FORM_open_html_disc (actionURL_mand, method, name) { var HTMLout = "<FORM CLASS=\"" + config.ADMINSETTING_CSSClass + "\" ACTION=\"" + actionURL_mand + "\""; if (isDefined_disc (method)) { HTMLout += " METHOD=\"" + method + "\""; } else { HTMLout += " METHOD=\"post\""; } if (isDefined_disc (name)) { HTMLout += " NAME=\"" + name + "\""; } else { HTMLout += " NAME=\"ASPF\""; } HTMLout += ">"; return HTMLout; } function FORM_close_html_disc (actionURL_mand) { return "</FORM>"; } function HTML_open_html_disc () { return "<HTML CLASS=\"" + config.ADMINSETTING_CSSClass + "\">"; } function HTML_close_html_disc () { return "</HTML>"; } function IFRAME_open_html_disc (name_mand, ID, width, height) { var HTMLout = "<IFRAME NAME=\"" + name_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (ID)) { HTMLout += " ID=\"" + ID + "\""; } if (isDefined_disc (width)) { HTMLout += " WIDTH=\"" + width + "\""; } if (isDefined_disc (height)) { HTMLout += " HEIGHT=\"" + height + "\""; } HTMLout += ">"; return HTMLout; } function IFRAME_close_html_disc () { return "</IFRAME>"; } function IMG_html_disc (sourceURL_mand, altText, border, width, height, ID, name, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, align, hspace, vspace) { var HTMLout = "<IMG CLASS=\"" + config.ADMINSETTING_CSSClass + "\" SRC=\"" + sourceURL_mand + "\""; if (isDefined_disc (altText)) { HTMLout += " ALT=\"" + altText + "\""; } if (isDefined_disc (border)) { HTMLout += " BORDER=\"" + border + "\""; } if (isDefined_disc (width)) { HTMLout += " WIDTH=\"" + width + "\""; } if (isDefined_disc (height)) { HTMLout += " HEIGHT=\"" + height + "\""; } if (isDefined_disc (ID)) { HTMLout += " ID=\"" + ID + "\""; } if (isDefined_disc (name)) { HTMLout += " NAME=\"" + name + "\""; } if (isDefined_disc (onClick)) { HTMLout += " onclick=\"" + onClick + "\""; } if (isDefined_disc (onMouseOver)) { HTMLout += " onmouseover=\"" + onMouseOver + "\""; } if (isDefined_disc (onMouseOut)) { HTMLout += " onmouseout=\"" + onMouseOut + "\""; } if (isDefined_disc (onMouseDown)) { HTMLout += " onmousedown=\"" + onMouseDown + "\""; } if (isDefined_disc (onMouseUp)) { HTMLout += " onmouseup=\"" + onMouseUp + "\""; } if (isDefined_disc (align)) { HTMLout += " align=\"" + align + "\""; } if (isDefined_disc (hspace)) { HTMLout += " HSPACE=\"" + hspace + "\""; } if (isDefined_disc (vspace)) { HTMLout += " VSPACE=\"" + vspace + "\""; } HTMLout += " />"; return HTMLout; } function INPUT_checkbox_html_disc (fieldName_mand, fieldValue_mand, checkedOrNot) { var HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"checkbox\""; if (isDefined_disc (checkedOrNot)) { HTMLout += checkedOrNot; } HTMLout += " />"; return HTMLout; } function INPUT_hidden_html_disc (fieldName_mand, fieldValue_mand) { return "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"hidden\" />"; } function INPUT_password_html_disc (fieldName_mand, fieldValue_mand, fieldSize, fieldMaxLength) { var HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"password\""; if (isUndefined_disc (fieldSize)) { fieldSize = config.ADMINSETTING_TextAreaRows; } HTMLout += " SIZE=\"" + fieldSize + "\""; if (isUndefined_disc (fieldMaxLength)) { fieldMaxLength = config.ADMINSETTING_InputboxMaxLength; } HTMLout += " MAXLENGTH=\"" + fieldMaxLength + "\">"; return HTMLout; } function INPUT_submit_html_disc (fieldName, fieldValue_mand) { var HTMLout; if (ASPFTextControl.isUsed ()) { HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"button\" onclick=\"submitRecord (); return false;\""; if (isDefined_disc (fieldName)) { HTMLout += " NAME=\"" + fieldName + "\""; } HTMLout += " />"; } else { HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"submit\""; if (isDefined_disc (fieldName)) { HTMLout += " NAME=\"" + fieldName + "\""; } HTMLout += " />"; } return HTMLout; } function INPUT_text_html_disc (fieldName_mand, fieldValue_mand, fieldSize, fieldMaxLength) { var HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"text\""; if (isUndefined_disc (fieldSize)) { fieldSize = config.ADMINSETTING_TextAreaRows; } HTMLout += " SIZE=\"" + fieldSize + "\""; if (isUndefined_disc (fieldMaxLength)) { fieldMaxLength = config.ADMINSETTING_InputboxMaxLength; } HTMLout += " MAXLENGTH=\"" + fieldMaxLength + "\">"; return HTMLout; } function LI_html_disc () { return "<LI CLASS=\"" + config.ADMINSETTING_CSSClass + "\" />"; } function JS_open_html_disc () { return "\n<SCR" + "IPT LANGUAGE=\"JavaScript\">\n<" + "!--\n"; } function JS_close_html_disc () { return "\n// -->\n</SCR" + "IPT>\n"; } function MAILTO_html_disc (emailAddress_mand, name_mand, emailLinkText) { var emailLink; if (config.ADMINSWITCH_ShowEmailAddresses) { emailLink = ASPFHTML.A_open ("mailto:" + emailAddress_mand, config.USERTEXT_SHOW_PopupEmailPrefix + name_mand + " (" + emailAddress_mand + ")") + emailLinkText + ASPFHTML.A_close (); } else { emailLink = name_mand; } return emailLink; } function NBSP_html_disc () { return " "; } function NBSP_multi_html_disc (numRequired) { var multiNBSP; if (isDefined_disc (numRequired)) { multiNBSP = ""; for (var counter = 0; counter < numRequired; counter++) { multiNBSP += " "; } } return multiNBSP; } function OL_open_html_disc () { return "<OL CLASS=\"" + config.ADMINSETTING_CSSClass + "\">"; } function OL_close_html_disc () { return "</OL>"; } function OPTION_html_disc (value_mand, selected) { if (isDefined_disc (selected) && selected) { selected = " SELECTED"; } else { selected = ""; } return "<OPTION VALUE=\"" + value_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\"" + selected + " />"; } function P_open_html_disc () { return "<P CLASS=\"" + config.ADMINSETTING_CSSClass + "\">"; } function P_close_html_disc () { return "</P>"; } function QUOTE_open_html_disc () { return ""; } function QUOTE_close_html_disc () { return ""; } function SELECT_open_html_disc (name_mand, onChange) { var HTMLout = "<SELECT NAME=\"" + name_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (onChange)) { HTMLout += " onchange=\"" + onChange + "\""; } HTMLout += ">"; return HTMLout; } function SELECT_close_html_disc () { return "</SELECT>"; } function SPAN_open_html_disc (class_mand) { return "<SPAN CLASS=\"" + class_mand + "\">"; } function SPAN_close_html_disc () { return "</SPAN>"; } function STRONG_open_html_disc () { return "<STRONG CLASS=\"" + config.ADMINSETTING_CSSClass + "\">"; } function STRONG_close_html_disc () { return "</STRONG>"; } function STYLE_open_html_disc (type) { var HTMLout = ""; if (isUndefined_disc (type)) { type = "text/css"; } return "<STYLE TYPE=\"" + type + "\">"; } function STYLE_close_html_disc () { return "</STYLE>"; } function TABLE_open_html_disc (border, width, backgroundColour, style, cellpadding, cellspacing) { var HTMLout = "<TABLE CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (border)) { HTMLout += " BORDER=\"" + border + "\""; } if (isDefined_disc (width)) { HTMLout += " WIDTH=\"" + width + "\""; } if (isDefined_disc (backgroundColour)) { HTMLout += " BGCOLOR=\"" + backgroundColour + "\""; } if (isDefined_disc (style)) { HTMLout += " STYLE=\"" + style + "\""; } if (isDefined_disc (cellpadding)) { HTMLout += " CELLPADDING=\"" + cellpadding + "\""; } if (isDefined_disc (cellspacing)) { HTMLout += " CELLSPACING=\"" + cellspacing + "\""; } HTMLout += ">"; return HTMLout; } function TABLE_close_html_disc () { return "</TABLE>"; } function TD_open_html_disc (width, style, backgroundColour, alignment, vAlignment, colspan, nowrap, backgroundImage) { var HTMLout = "<TD CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (width)) { HTMLout += " WIDTH=\"" + width + "\""; } if (isDefined_disc (style)) { HTMLout += " STYLE=\"" + style + "\""; } if (isDefined_disc (backgroundColour)) { HTMLout += " BGCOLOR=\"" + backgroundColour + "\""; } if (isDefined_disc (alignment)) { HTMLout += " ALIGN=\"" + alignment + "\""; } if (isDefined_disc (vAlignment)) { HTMLout += " VALIGN=\"" + vAlignment + "\""; } if (isDefined_disc (colspan)) { HTMLout += " COLSPAN=\"" + colspan + "\""; } if (isDefined_disc (nowrap)) { if (nowrap) { HTMLout += " NOWRAP"; } } if (isDefined_disc (backgroundImage)) { HTMLout += " BACKGROUND=\"" + backgroundImage + "\""; } HTMLout += ">"; return HTMLout; } function TD_close_html_disc () { return "</TD>"; } function TEXTAREA_open_html_disc (fieldName_mand, columns, rows) { var HTMLout = "<TEXTAREA CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" WRAP=\"PHYSICAL\""; if (isDefined_disc (columns)) { HTMLout += " COLS=\"" + columns + "\""; } if (isDefined_disc (rows)) { HTMLout += " ROWS=\"" + rows + "\""; } HTMLout += ">"; return HTMLout; } function TEXTAREA_close_html_disc () { return "</TEXTAREA>"; } function TH_open_html_disc (style, alignment, vAlignment, nowrap) { var HTMLout = "<TH CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (style)) { HTMLout += " STYLE=\"" + style + "\""; } if (isDefined_disc (alignment)) { HTMLout += " ALIGN=\"" + alignment + "\""; } if (isDefined_disc (vAlignment)) { HTMLout += " VALIGN=\"" + vAlignment + "\""; } if (isDefined_disc (nowrap)) { if (nowrap) { HTMLout += " NOWRAP"; } } HTMLout += ">"; return HTMLout; } function TH_close_html_disc () { return "</TH>"; } function TR_open_html_disc (style) { var HTMLout = "<TR CLASS=\"" + config.ADMINSETTING_CSSClass + "\""; if (isDefined_disc (style)) { HTMLout += " STYLE=\"" + style + "\""; } HTMLout += ">"; return HTMLout; } function TR_close_html_disc () { return "</TR>"; } function UL_open_html_disc () { return "<UL TYPE=\"square\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\">"; } function UL_close_html_disc () { return "</UL>"; } function sanitise_html_disc () { var sanitisedTag = ""; if (this.isImage ()) { sanitisedTag = this.sanitiseImage (); } else if (this.isLinkOpen ()) { sanitisedTag = this.sanitiseLink (); } else { sanitisedTag = this.tagSource; } return sanitisedTag; } function isImage_html_disc () { var imageTag; if (this.tagSource.search ("^<\\s*IMG\\s") > -1) { imageTag = true; } else { imageTag = false; } return imageTag; } function isLinkOpen_html_disc () { var linkTag; if (this.tagSource.search ("^<\\s*A\\s") > -1) { linkTag = true; } else { linkTag = false; } return linkTag; } function isLinkClose_html_disc () { var linkTag; if (this.tagSource.search ("^<\\s*/\\s*A\\s") > -1) { linkTag = true; } else { linkTag = false; } return linkTag; } // ====================================================================== // // Private member methods. // // ====================================================================== function sanitiseImage_html_disc () { var tag = this.tagSource; var src = tag.getAttribute ("src"); var alt = tag.getAttribute ("alt"); if (isDefined_disc (alt)) { alt = config.USERTEXT_STRING_WarningUnverifiedImage + this.QUOTE_open () + alt + this.QUOTE_close (); } else { alt = config.USERTEXT_STRING_WarningUnverifiedImage; } var border = tag.getAttribute ("border"); var align = tag.getAttribute ("align"); var hspace = tag.getAttribute ("hspace"); var vspace = tag.getAttribute ("vspace"); return this.IMG (src, alt, border, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, align, hspace, vspace); } function sanitiseLink_html_disc () { var tag = this.tagSource; var href = tag.getAttribute ("href"); var title = tag.getAttribute ("title"); if (isDefined_disc (title)) { title = config.USERTEXT_STRING_WarningUnverifiedLink + this.QUOTE_open () + title + this.QUOTE_close (); } else { title = config.USERTEXT_STRING_WarningUnverifiedLink; } var name = tag.getAttribute ("name"); var id = tag.getAttribute ("id"); return this.A_open (href, title, name, undefined_disc, id); } ASPFHTML.A_open = A_open_html_disc; ASPFHTML.A_close = A_close_html_disc; ASPFHTML.BASE = BASE_html_disc; ASPFHTML.BLOCKQUOTE_open = BLOCKQUOTE_open_html_disc; ASPFHTML.BLOCKQUOTE_close = BLOCKQUOTE_close_html_disc; ASPFHTML.BODY_open = BODY_open_html_disc; ASPFHTML.BODY_close = BODY_close_html_disc; ASPFHTML.BR = BR_html_disc; ASPFHTML.DIV_open = DIV_open_html_disc; ASPFHTML.DIV_close = DIV_close_html_disc; ASPFHTML.DOUBLE_QUOTES = DOUBLE_QUOTES_html_disc; ASPFHTML.DTD = DTD_html_disc; ASPFHTML.FONT_open = FONT_open_html_disc; ASPFHTML.FONT_close = FONT_close_html_disc; ASPFHTML.FORM_open = FORM_open_html_disc; ASPFHTML.FORM_close = FORM_close_html_disc; ASPFHTML.HTML_open = HTML_open_html_disc; ASPFHTML.HTML_close = HTML_close_html_disc; ASPFHTML.IFRAME_open = IFRAME_open_html_disc; ASPFHTML.IFRAME_close = IFRAME_close_html_disc; ASPFHTML.IMG = IMG_html_disc; ASPFHTML.INPUT_checkbox = INPUT_checkbox_html_disc; ASPFHTML.INPUT_hidden = INPUT_hidden_html_disc; ASPFHTML.INPUT_password = INPUT_password_html_disc; ASPFHTML.INPUT_submit = INPUT_submit_html_disc; ASPFHTML.INPUT_text = INPUT_text_html_disc; ASPFHTML.JS_open = JS_open_html_disc; ASPFHTML.JS_close = JS_close_html_disc; ASPFHTML.LI = LI_html_disc; ASPFHTML.MAILTO = MAILTO_html_disc; ASPFHTML.NBSP = NBSP_html_disc; ASPFHTML.NBSP_multi = NBSP_multi_html_disc; ASPFHTML.OL_open = OL_open_html_disc; ASPFHTML.OL_close = OL_close_html_disc; ASPFHTML.OPTION = OPTION_html_disc; ASPFHTML.P_open = P_open_html_disc; ASPFHTML.P_close = P_close_html_disc; ASPFHTML.QUOTE_open = QUOTE_open_html_disc; ASPFHTML.QUOTE_close = QUOTE_close_html_disc; ASPFHTML.SELECT_open = SELECT_open_html_disc; ASPFHTML.SELECT_close = SELECT_close_html_disc; ASPFHTML.SPAN_open = SPAN_open_html_disc; ASPFHTML.SPAN_close = SPAN_close_html_disc; ASPFHTML.STRONG_open = STRONG_open_html_disc; ASPFHTML.STYLE_open = STYLE_open_html_disc; ASPFHTML.STYLE_close = STYLE_close_html_disc; ASPFHTML.STRONG_close = STRONG_close_html_disc; ASPFHTML.TABLE_open = TABLE_open_html_disc; ASPFHTML.TABLE_close = TABLE_close_html_disc; ASPFHTML.TD_open = TD_open_html_disc; ASPFHTML.TD_close = TD_close_html_disc; ASPFHTML.TEXTAREA_open = TEXTAREA_open_html_disc; ASPFHTML.TEXTAREA_close = TEXTAREA_close_html_disc; ASPFHTML.TH_open = TH_open_html_disc; ASPFHTML.TH_close = TH_close_html_disc; ASPFHTML.TR_open = TR_open_html_disc; ASPFHTML.TR_close = TR_close_html_disc; ASPFHTML.UL_open = UL_open_html_disc; ASPFHTML.UL_close = UL_close_html_disc; ASPFHTML.prototype.A_open = A_open_html_disc; ASPFHTML.prototype.A_close = A_close_html_disc; ASPFHTML.prototype.BASE = BASE_html_disc; ASPFHTML.prototype.BLOCKQUOTE_open = BLOCKQUOTE_open_html_disc; ASPFHTML.prototype.BLOCKQUOTE_close = BLOCKQUOTE_close_html_disc; ASPFHTML.prototype.BODY_open = BODY_open_html_disc; ASPFHTML.prototype.BODY_close = BODY_close_html_disc; ASPFHTML.prototype.BR = BR_html_disc; ASPFHTML.prototype.DIV_open = DIV_open_html_disc; ASPFHTML.prototype.DIV_close = DIV_close_html_disc; ASPFHTML.prototype.DOUBLE_QUOTES = DOUBLE_QUOTES_html_disc; ASPFHTML.prototype.DTD = DTD_html_disc; ASPFHTML.prototype.FONT_open = FONT_open_html_disc; ASPFHTML.prototype.FONT_close = FONT_close_html_disc; ASPFHTML.prototype.FORM_open = FORM_open_html_disc; ASPFHTML.prototype.FORM_close = FORM_close_html_disc; ASPFHTML.prototype.HTML_open = HTML_open_html_disc; ASPFHTML.prototype.HTML_close = HTML_close_html_disc; ASPFHTML.prototype.IFRAME_open = IFRAME_open_html_disc; ASPFHTML.prototype.IFRAME_close = IFRAME_close_html_disc; ASPFHTML.prototype.IMG = IMG_html_disc; ASPFHTML.prototype.INPUT_checkbox = INPUT_checkbox_html_disc; ASPFHTML.prototype.INPUT_hidden = INPUT_hidden_html_disc; ASPFHTML.prototype.INPUT_password = INPUT_password_html_disc; ASPFHTML.prototype.INPUT_submit = INPUT_submit_html_disc; ASPFHTML.prototype.INPUT_text = INPUT_text_html_disc; ASPFHTML.prototype.JS_open = JS_open_html_disc; ASPFHTML.prototype.JS_close = JS_close_html_disc; ASPFHTML.prototype.LI = LI_html_disc; ASPFHTML.prototype.MAILTO = MAILTO_html_disc; ASPFHTML.prototype.NBSP = NBSP_html_disc; ASPFHTML.prototype.NBSP_multi = NBSP_multi_html_disc; ASPFHTML.prototype.OPTION = OPTION_html_disc; ASPFHTML.prototype.OL_open = OL_open_html_disc; ASPFHTML.prototype.OL_close = OL_close_html_disc; ASPFHTML.prototype.P_open = P_open_html_disc; ASPFHTML.prototype.P_close = P_close_html_disc; ASPFHTML.prototype.QUOTE_open = QUOTE_open_html_disc; ASPFHTML.prototype.QUOTE_close = QUOTE_close_html_disc; ASPFHTML.prototype.SELECT_open = SELECT_open_html_disc; ASPFHTML.prototype.SELECT_close = SELECT_close_html_disc; ASPFHTML.prototype.STRONG_open = STRONG_open_html_disc; ASPFHTML.prototype.SPAN_open = SPAN_open_html_disc; ASPFHTML.prototype.SPAN_close = SPAN_close_html_disc; ASPFHTML.prototype.STRONG_close = STRONG_close_html_disc; ASPFHTML.prototype.STYLE_open = STYLE_open_html_disc; ASPFHTML.prototype.STYLE_close = STYLE_close_html_disc; ASPFHTML.prototype.TABLE_open = TABLE_open_html_disc; ASPFHTML.prototype.TABLE_close = TABLE_close_html_disc; ASPFHTML.prototype.TD_open = TD_open_html_disc; ASPFHTML.prototype.TD_close = TD_close_html_disc; ASPFHTML.prototype.TEXTAREA_open = TEXTAREA_open_html_disc; ASPFHTML.prototype.TEXTAREA_close = TEXTAREA_close_html_disc; ASPFHTML.prototype.TH_open = TH_open_html_disc; ASPFHTML.prototype.TH_close = TH_close_html_disc; ASPFHTML.prototype.TR_open = TR_open_html_disc; ASPFHTML.prototype.TR_close = TR_close_html_disc; ASPFHTML.prototype.UL_open = UL_open_html_disc; ASPFHTML.prototype.UL_close = UL_close_html_disc; ASPFHTML.prototype.sanitise = sanitise_html_disc; ASPFHTML.prototype.isImage = isImage_html_disc; ASPFHTML.prototype.isLinkOpen = isLinkOpen_html_disc; ASPFHTML.prototype.isLinkClose = isLinkClose_html_disc; ASPFHTML.prototype.sanitiseImage = sanitiseImage_html_disc; ASPFHTML.prototype.sanitiseLink = sanitiseLink_html_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // MESSAGE OBJECT // // ====================================================================== function ASPFMessage (message) { this.setAllFields (message); return this; } // ====================================================================== // // Interface to private member variables. // // ====================================================================== function getSubject_msg_disc () { return this.subject; } function setSubject_msg_disc (newSubject) { this.subject = newSubject; return; } function getBody_msg_disc () { return this.body; } function setBody_msg_disc (newBody) { this.body = newBody; return; } function getSortCode_msg_disc () { return this.sortCode; } function setSortCode_msg_disc (newSortCode) { this.sortCode = newSortCode; return; } function getAuthorName_msg_disc () { return this.authorName; } function setAuthorName_msg_disc (newAuthorName) { this.authorName = newAuthorName; return; } function getAuthorEmail_msg_disc () { return this.authorEmail; } function setAuthorEmail_msg_disc (newAuthorEmail) { this.authorEmail = newAuthorEmail; return; } function getAuthorFullname_msg_disc () { return this.authorFullname; } function setAuthorFullname_msg_disc (newAuthorFullname) { this.authorFullname = newAuthorFullname; return; } function getMessageID_msg_disc () { return this.messageID; } function setMessageID_msg_disc (newMessageID) { this.messageID = newMessageID; return; } function getParentID_msg_disc () { return this.parentID; } function setParentID_msg_disc (newParentID) { this.parentID = newParentID; return; } function getThreadID_msg_disc () { return this.threadID; } function setThreadID_msg_disc (newThreadID) { this.threadID = newThreadID; return; } function getNumChildren_msg_disc () { return this.numChildren; } function setNumChildren_msg_disc (newNumChildren) { this.numChildren = newNumChildren; return; } function getDateCreated_msg_disc () { return new Date (this.dateCreated); } function setDateCreated_msg_disc (newDateCreated) { this.dateCreated = newDateCreated; return; } function getDateModified_msg_disc () { return new Date (this.dateModified); } function setDateModified_msg_disc (newDateModified) { this.dateModified = newDateModified; return; } function getEmailParentOnResponse_msg_disc () { var emailResponse = false; if ((this.emailParentOnResponse == "true") || (this.emailParentOnResponse == true)) { emailResponse = true; } return emailResponse; } function setEmailParentOnResponse_msg_disc (newEmailParentOnResponse) { this.emailParentOnResponse = newEmailParentOnResponse; return; } // ====================================================================== // // Main object methods. // // ====================================================================== function setAllFieldsEmpty_msg_disc () { this.subject = ""; this.body = ""; this.sortCode = ""; this.authorName = ""; this.authorEmail = ""; this.authorFullname = ""; this.messageID = 0; this.parentID = 0; this.threadID = 0; this.numChildren = 0; this.dateCreated = new Date ("1/1/00"); this.dateModified = new Date ("1/1/00"); this.emailParentOnResponse = false; return; } function setAllFieldsFromRecordSet_msg_disc (newMessageRecord) { if ((newMessageRecord != null) && (!newMessageRecord.EOF)) { var dBase = new ASPFDatabase (); this.subject = dBase.getSubjectField (newMessageRecord); this.body = dBase.getBodyField (newMessageRecord); this.sortCode = dBase.getSortCodeField (newMessageRecord); this.authorName = dBase.getAuthorNameField (newMessageRecord); this.authorEmail = dBase.getAuthorEmailField (newMessageRecord); this.authorFullname = dBase.getAuthorFullnameField (newMessageRecord); this.messageID = dBase.getMessageIDField (newMessageRecord).Value; this.parentID = dBase.getParentIDField (newMessageRecord).Value; this.threadID = dBase.getThreadIDField (newMessageRecord).Value; this.numChildren = dBase.getNumChildrenField (newMessageRecord).Value; this.dateCreated = dBase.getDateCreatedField (newMessageRecord); this.dateModified = dBase.getDateModifiedField (newMessageRecord); this.emailParentOnResponse = dBase.getEmailParentOnResponseField (newMessageRecord).Value; delete dBase; } else { this.setAllFieldsEmpty (); } return; } function setAllFieldsFromMessage_msg_disc (newMessage) { this.subject = newMessage.getSubject (); this.body = newMessage.getBody (); this.sortCode = newMessage.getSortCode (); this.authorName = newMessage.getAuthorName (); this.authorEmail = newMessage.getAuthorEmail (); this.authorFullname = newMessage.getAuthorFullname (); this.messageID = newMessage.getMessageID (); this.parentID = newMessage.getParentID (); this.threadID = newMessage.getThreadID (); this.numChildren = newMessage.getNumChildren (); this.dateCreated = newMessage.getDateCreated (); this.dateModified = newMessage.getDateModified (); this.emailParentOnResponse = newMessage.getEmailParentOnResponse (); return; } function setAllFieldsFromForm_msg_disc (newMessageForm) { this.subject = safeStringDereference_disc (newMessageForm.getSubject ()); this.body = safeStringDereference_disc (newMessageForm.getBody ()); this.sortCode = safeNumberDereference_disc (newMessageForm.getSortCode ()); this.parentID = safeNumberDereference_disc (newMessageForm.getParentID ()); this.threadID = safeNumberDereference_disc (newMessageForm.getThreadID ()); this.messageID = safeNumberDereference_disc (newMessageForm.getMessageID ()); this.emailParentOnResponse = safeStringDereference_disc (newMessageForm.getEmailParentOnResponse ()); this.authorName = safeStringDereference_disc (newMessageForm.getAuthorName ()); this.authorEmail = safeStringDereference_disc (newMessageForm.getAuthorEmail ()); this.authorFullname = safeStringDereference_disc (newMessageForm.getAuthorFullname ()); return; } function setAllFields_msg_disc (newMessage) { if (newMessage instanceof ASPFForm) { this.setAllFieldsFromForm (newMessage); } else if (newMessage instanceof ASPFMessage) { this.setAllFieldsFromMessage (newMessage); } else { this.setAllFieldsFromRecordSet (newMessage); } return; } function getExpandCollapse_msg_disc (viewIndex, activeThreadID, pageURLToUse) { var expandCollapse = new ASPFExpandCollapse (this, viewIndex, 0, activeThreadID, pageURLToUse); var HTMLout = ASPFHTML.FONT_open (2) + expandCollapse.getIcon() + ASPFHTML.FONT_close () + ASPFHTML.TD_close () + ASPFHTML.TD_open (); delete expandCollapse; return HTMLout; } function getDHTMLExpandCollapse_msg_disc (currentIndentLevel, pageURLToUse) { var expandCollapse = new ASPFExpandCollapse (this, 0, 0, 0, pageURLToUse); var HTMLout = ASPFHTML.FONT_open (2) + expandCollapse.getDHTMLIcon (currentIndentLevel) + ASPFHTML.FONT_close () + ASPFHTML.TD_close () + ASPFHTML.TD_open (); delete expandCollapse; return HTMLout; } function getViewEntry_msg_disc (activeMessageID) { var subjectLineString = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewSubject); if (Number (activeMessageID) == Number (this.messageID)) { subjectLineString += this.subject.strong(); } else { subjectLineString += this.getSubjectLink().strong(); } subjectLineString += ASPFHTML.SPAN_close (); subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewAuthor); subjectLineString += config.USERTEXT_VIEW_SeparateSubjectAuthor + String (this.authorFullname).strongSmall(); subjectLineString += " (" + ASPFHTML.QUOTE_open (); subjectLineString += ASPFHTML.MAILTO (this.authorEmail, this.authorName, this.authorName); subjectLineString += ASPFHTML.QUOTE_close () + ") "; subjectLineString += ASPFHTML.SPAN_close (); subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewDate); subjectLineString += config.USERTEXT_VIEW_SeparateAuthorDate + this.getDateCreated ().getShortFormat (); subjectLineString += ASPFHTML.SPAN_close (); if (this.numChildren == 0) { subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewNoChildren); subjectLineString += " (" + config.USERTEXT_VIEW_NoRepliesTag + ")"; subjectLineString += ASPFHTML.SPAN_close (); } else if (this.numChildren == 1) { subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewOneChild); subjectLineString += " (" + this.numChildren + config.USERTEXT_VIEW_OneReplyTag + ")"; subjectLineString += ASPFHTML.SPAN_close (); } else { subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewManyChildren); subjectLineString += " (" + this.numChildren + config.USERTEXT_VIEW_ManyRepliesTag + ")"; subjectLineString += ASPFHTML.SPAN_close (); } subjectLineString = subjectLineString.weakSmall(); return subjectLineString; } function getSubjectLink_msg_disc () { var HTMLout; HTMLout = ASPFHTML.A_open (config.getShowMessagePagePath () + "?" + config.FORM_QueryStringMessageID + "=" + this.messageID, config.USERTEXT_SHOW_PopupSubjectPrefix + ASPFHTML.QUOTE_open () + this.subject.stripAllTags () + ASPFHTML.QUOTE_close ()); HTMLout += this.subject; HTMLout += ASPFHTML.A_close (); return HTMLout; } function getSummary_msg_disc () { var dateCreated = new Date (this.dateCreated); return ASPFHTML.LI () + this.getSubjectLink () + config.USERTEXT_VIEW_SeparateSubjectAuthor + this.getAuthorName () + config.USERTEXT_VIEW_SeparateAuthorDate + dateCreated.getLongFormat () + ASPFHTML.BLOCKQUOTE_open () + this.body.precis () + ASPFHTML.BLOCKQUOTE_close (); } function sendAdminAlert_msg_disc (pureSubject, pureBody) { if ("" != config.ADMINSETTING_EmailAdminAddress) { var adminEmail; adminEmail = new ASPFEmail (); adminEmail.toName = config.ADMINSETTING_EmailAdminName; adminEmail.toAddress = config.ADMINSETTING_EmailAdminAddress; adminEmail.fromName = this.authorFullname; adminEmail.fromAddress = this.authorEmail; adminEmail.subject = config.USERTEXT_MAIL_AdminNewPostSubjectPrefix + " (" + config.ADMINSETTING_ForumName + "): " + pureSubject; if (config.ADMINSWITCH_AllowHTMLEmail) { var HTMLBody; HTMLBody = config.USERTEXT_MAIL_AdminNewPostBodyPrefix + this.authorFullname + config.USERTEXT_MAIL_AdminNewPostSeparateNameForum + config.ADMINSETTING_ForumName HTMLBody += ASPFHTML.P_open () + this.subject.strong() + ASPFHTML.P_close (); HTMLBody += this.body.messageBody(); HTMLBody += ASPFHTML.P_open () + ASPFPageElement.getNewReplyButton () + ASPFHTML.P_close (); adminEmail.body = adminEmail.getHTMLMessageBody (this, config.ADMINSETTING_ForumName, HTMLBody, config.ADMINSETTING_EmailAlertSignatureHTML); adminEmail.sendHTML (); } else { adminEmail.body = config.USERTEXT_MAIL_AdminNewPostBodyPrefix + this.authorFullname + config.USERTEXT_MAIL_AdminNewPostSeparateNameForum + config.ADMINSETTING_ForumName + "\n\n" + pureBody.stripAllTags (); adminEmail.send (); } delete adminEmail; } return; } function sendUserAlert_msg_disc (pureSubject, pureBody) { if ((config.ADMINSWITCH_AllowEmailResponses) && (this.parentID != 0)) { var dBase = new ASPFDatabase (); var parentMessage = dBase.getMessageByID (this.parentID); if (parentMessage != null) { if (parentMessage.getEmailParentOnResponse ()) { var userAlert = new ASPFEmail (); userAlert.subject = this.authorFullname + config.USERTEXT_MAIL_UserNewPostSeparateNameForum + config.ADMINSETTING_ForumName; userAlert.toAddress = parentMessage.getAuthorEmail (); userAlert.toName = parentMessage.getAuthorFullname (); userAlert.fromAddress = config.ADMINSETTING_EmailAlertFromAddress; userAlert.fromName = config.ADMINSETTING_EmailAlertFromName; var subject = pureSubject; if ((config.ADMINSWITCH_AllowHTMLEmail) && (config.getUserHTMLMailPreference (parentMessage.getAuthorName ()))) { var HTMLBody; HTMLBody = this.authorFullname; HTMLBody += config.USERTEXT_MAIL_UserNewPostNameSuffix; HTMLBody += config.USERTEXT_MAIL_UserNewPostMessagePrefix; HTMLBody += ASPFHTML.P_open () + subject.strong() + ASPFHTML.P_close (); HTMLBody += this.body.messageBody(); HTMLBody += ASPFHTML.P_open (); HTMLBody += ASPFPageElement.getNewReplyButton (); HTMLBody += ASPFHTML.P_close (); userAlert.body = userAlert.getHTMLMessageBody (this, config.ADMINSETTING_ForumName, HTMLBody, config.ADMINSETTING_EmailAlertSignatureHTML); userAlert.sendHTML (); } else { userAlert.body = this.authorFullname + config.USERTEXT_MAIL_UserNewPostSeparateNameMessage + subject; userAlert.body += "\n\n" + config.USERTEXT_MAIL_UserNewPostMessagePrefix + "\n\n\n" + subject; userAlert.body += "\n\n" + pureBody.stripAllTags () + "\n" + config.ADMINSETTING_EmailAlertSignature; userAlert.send (); } delete userAlert; } } delete dbase; } return; } function saveAsNewMessage_msg_disc (successfulMessage, failedMessagePrefix) { var successful; var pureBody = this.body.purify (); var pureSubject = this.subject.purify (); this.normalisePost (); var successOrFailure = this.validatePost (); if (successOrFailure.number == config.CONST_NoError) { var dBase = new ASPFDatabase (); dBase.saveNewRecord (this); successfulMessage.strong().show (); currentMessage_disc = this; successful = true; this.sendAdminAlert (pureSubject, pureBody); this.sendUserAlert (pureSubject, pureBody); delete dBase; } else { failedMessagePrefix = failedMessagePrefix.paragraph (); failedMessagePrefix.show (); successOrFailure.description.show (); successful = false; } delete successOrFailure; return successful; } function saveAsUpdatedMessage_msg_disc (successfulMessage, failedMessagePrefix) { var successful; var errorString; this.normalisePost(); var successOrFailure = this.validatePost (); if (successOrFailure.number == config.CONST_NoError) { var dBase = new ASPFDatabase (); dBase.saveUpdatedRecord (this); successfulMessage = successfulMessage.paragraph (); successfulMessage.strong().show(); successful = true; delete dBase; } else { failedMessagePrefix = failedMessagePrefix.paragraph (); failedMessagePrefix.show (); successOrFailure.description.show (); successful = false; } delete successOrFailure; return successful; } function saveUpdatedData_msg_disc () { var dBase = new ASPFDatabase (); dBase.saveUpdatedRecord (this); delete dBase; return; } function normalisePost_msg_disc () { this.threadID = Number (this.threadID); this.sortCode = String (this.sortCode).substr (0, config.DATABASE_MaxSortcodeSize); this.parentID = Number (this.parentID); this.emailResponses = Boolean (this.emailResponses); this.subject = this.subject.substr (0, config.DATABASE_MaxSubjectSize).formatForStoring (); this.body = this.body.substr (0, config.DATABASE_MaxMessageSize).formatForStoring (); this.authorName = this.authorName.substr (0, config.DATABASE_MaxUsernameSize).formatForStoring (); this.authorFullname = this.authorFullname.substr (0, config.DATABASE_MaxFullnameSize).formatForStoring (); this.authorEmailAddress = this.authorEmail.substr (0, config.DATABASE_MaxEmailAddressSize).formatForStoring (); return; } function validatePost_msg_disc () { var errors = ASPFHTML.UL_open (); var valid = true; if (this.authorName == "") { errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoUsername; valid = false; } if (this.authorFullname == "") { errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoName; valid = false; } if (this.authorEmail == "") { errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoEmail; valid = false; } if (this.subject == "") { errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoSubject; valid = false; } if (this.body == "") { errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoBody; valid = false; } errors += ASPFHTML.UL_close (); valid = (valid ? config.CONST_NoError : config.CONST_Error); return new Error (valid, errors); } function getRenderedHTML_msg_disc () { var HTMLout = ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, config.ADMINSETTING_TableFullWidth, undefined_disc, undefined_disc, 0, 0); var email = new ASPFEmail(); email.fromName = this.authorFullname; email.fromAddress = this.authorEmail; HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedByLabel); HTMLout += config.USERTEXT_SHOW_PostedByPrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedBy); HTMLout += (this.authorName + " (" + ASPFHTML.QUOTE_open () + email.getFromEmailLink() + ASPFHTML.QUOTE_close () + ")").strong (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedOnLabel); HTMLout += config.USERTEXT_SHOW_PostedOnPrompt.weak (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom"); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedOn); HTMLout += this.getDateCreated ().getLongFormat ().strong (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2); HTMLout += ASPFHTML.NBSP (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgBodyLabel); HTMLout += (config.USERTEXT_SHOW_BodyPrompt + ASPFHTML.BR ()).strong (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgBody); HTMLout += this.body.messageBody (); HTMLout += ASPFHTML.SPAN_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TABLE_close (); delete email; return HTMLout; } ASPFMessage.prototype.getSubject = getSubject_msg_disc; ASPFMessage.prototype.setSubject = setSubject_msg_disc; ASPFMessage.prototype.getBody = getBody_msg_disc; ASPFMessage.prototype.setBody = setBody_msg_disc; ASPFMessage.prototype.getSortCode = getSortCode_msg_disc; ASPFMessage.prototype.setSortCode = setSortCode_msg_disc; ASPFMessage.prototype.getAuthorName = getAuthorName_msg_disc; ASPFMessage.prototype.setAuthorName = setAuthorName_msg_disc; ASPFMessage.prototype.getAuthorEmail = getAuthorEmail_msg_disc; ASPFMessage.prototype.setAuthorEmail = setAuthorEmail_msg_disc; ASPFMessage.prototype.getAuthorFullname = getAuthorFullname_msg_disc; ASPFMessage.prototype.setAuthorFullname = setAuthorFullname_msg_disc; ASPFMessage.prototype.getMessageID = getMessageID_msg_disc; ASPFMessage.prototype.setMessageID = setMessageID_msg_disc; ASPFMessage.prototype.getParentID = getParentID_msg_disc; ASPFMessage.prototype.setParentID = setParentID_msg_disc; ASPFMessage.prototype.getThreadID = getThreadID_msg_disc; ASPFMessage.prototype.setThreadID = setThreadID_msg_disc; ASPFMessage.prototype.getNumChildren = getNumChildren_msg_disc; ASPFMessage.prototype.setNumChildren = setNumChildren_msg_disc; ASPFMessage.prototype.getDateCreated = getDateCreated_msg_disc; ASPFMessage.prototype.setDateCreated = setDateCreated_msg_disc; ASPFMessage.prototype.getDateModified = getDateModified_msg_disc; ASPFMessage.prototype.setDateModified = setDateModified_msg_disc; ASPFMessage.prototype.getEmailParentOnResponse = getEmailParentOnResponse_msg_disc; ASPFMessage.prototype.setEmailParentOnResponse = setEmailParentOnResponse_msg_disc; ASPFMessage.prototype.getSummary = getSummary_msg_disc; ASPFMessage.prototype.getSubjectLink = getSubjectLink_msg_disc; ASPFMessage.prototype.getViewEntry = getViewEntry_msg_disc; ASPFMessage.prototype.setAllFieldsEmpty = setAllFieldsEmpty_msg_disc; ASPFMessage.prototype.setAllFieldsFromForm = setAllFieldsFromForm_msg_disc; ASPFMessage.prototype.setAllFieldsFromMessage = setAllFieldsFromMessage_msg_disc; ASPFMessage.prototype.setAllFieldsFromRecordSet = setAllFieldsFromRecordSet_msg_disc; ASPFMessage.prototype.setAllFields = setAllFields_msg_disc; ASPFMessage.prototype.getExpandCollapse = getExpandCollapse_msg_disc; ASPFMessage.prototype.getDHTMLExpandCollapse = getDHTMLExpandCollapse_msg_disc; ASPFMessage.prototype.sendAdminAlert = sendAdminAlert_msg_disc; ASPFMessage.prototype.sendUserAlert = sendUserAlert_msg_disc; ASPFMessage.prototype.saveAsNewMessage = saveAsNewMessage_msg_disc; ASPFMessage.prototype.saveAsUpdatedMessage = saveAsUpdatedMessage_msg_disc; ASPFMessage.prototype.saveUpdatedData = saveUpdatedData_msg_disc; ASPFMessage.prototype.normalisePost = normalisePost_msg_disc; ASPFMessage.prototype.validatePost = validatePost_msg_disc; ASPFMessage.prototype.getRenderedHTML = getRenderedHTML_msg_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesserhttp://localhost:800/ASPForums/dev/ General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // PAGE OBJECT // // ====================================================================== function ASPFPageElement () { return this; } function showVersion_page_disc () { if (!ASPFPageElement.versionRefOutput) { var versionRef = "\n<" + "!-- GENERATED BY: " + config.SYS_CurrentVersionReference + " -->\n"; versionRef.show (); ASPFPageElement.versionRefOutput = true; } return; } function setCurrentMessage_page_disc () { if (isUndefined_disc (currentMessage_disc)) { if (!isNaN (Request.QueryString (config.FORM_QueryStringMessageID))) { var dBase = new ASPFDatabase (); currentMessage_disc = dBase.getMessageByID (Request.QueryString (config.FORM_QueryStringMessageID)); delete dBase; } } return; } function showStandardMessage_page_disc () { this.showVersion (); this.setCurrentMessage (); this.showCurrentMessage (); this.showForumLink (); var table = ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize) + ASPFHTML.TR_open () + ASPFHTML.TD_open (); table.show (); this.showNewReplyButton (); table = ASPFHTML.TD_close () + ASPFHTML.TD_open (); table.show (); if (config.ADMINSWITCH_ShowNewPostButtonOnMessage == true) { this.showNewPostButton (); } table = ASPFHTML.TD_close () + ASPFHTML.TD_open (); table.show (); this.showEditPostButton (); table = ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TABLE_close (); table.show (); } function showForumLink_page_disc () { this.showVersion (); var HTMLout = ASPFHTML.P_open () + this.getForumLink (config.USERTEXT_POST_ForumLinkPrefix + config.ADMINSETTING_ForumName).weak () + ASPFHTML.P_close (); HTMLout.show (); return; } function showForumTitle_page_disc () { config.ADMINSETTING_ForumName.show (); return; } function showMessageSubject_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.subject.show (); } return; } function showMessageBody_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.body.show (); } return; } function showMessageAuthorName_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.authorName.show (); } return; } function showMessageAuthorEmail_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.authorEmail.show (); } return; } function showMessageAuthorFullname_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.authorFullname.show (); } return; } function showMessageDateCreated_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.dateCreated.show (); } return; } function showMessageDateModified_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.dateModified.show (); } return; } function showMessageSortCode_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { currentMessage_disc.sortCode.show (); } return; } function showMessageNumChildren_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { String (currentMessage_disc.numChildren).show (); } return; } function showMessageID_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { String (currentMessage_disc.messageID).show (); } return; } function showMessageParentID_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { String (currentMessage_disc.parentID).show (); } return; } function showMessageThreadID_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { String (currentMessage_disc.threadID).show (); } return; } function showParentMessageLink_page_disc () { this.showVersion (); var link = this.getParentMessageLink (config.USERTEXT_POST_PreviousMessageLinkText); link.show (); return; } function showSearchForm_page_disc () { this.showVersion (); var HTMLout; var searchForm = new ASPFForm (Request.Form); HTMLout = searchForm.getSearchForm (config.USERTEXT_SEARCH_SubmitButton); HTMLout.show (); delete searchForm; return; } function showSmallSearchForm_page_disc () { this.showVersion (); var HTMLout; var searchForm = new ASPFForm (Request.Form); HTMLout = searchForm.getSmallSearchForm (config.USERTEXT_SEARCH_SubmitButton); HTMLout.show (); delete searchForm; return; } function showNewPostButton_page_disc () { this.showVersion (); var postButton = ASPFHTML.FORM_open (config.getNewPostPagePath ()); postButton += ASPFHTML.INPUT_submit (config.USERTEXT_SHOW_NewPostButton, config.USERTEXT_SHOW_NewPostButton); postButton += ASPFHTML.FORM_close (); postButton.show (); return; } function showNewPostLink_page_disc () { this.showVersion (); var link = ASPFHTML.A_open (config.getNewPostPagePath ()) + config.USERTEXT_SHOW_NewPostButton + ASPFHTML.A_close (); link.show (); return; } function showCurrentMessage_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { var messageHTML = currentMessage_disc.getRenderedHTML (); messageHTML.show (); } return; } function showNewReplyButton_page_disc () { this.showVersion (); this.setCurrentMessage (); var HTMLout = this.getNewReplyButton (); HTMLout.show (); return; } function showEditPostButton_page_disc () { this.showVersion (); this.setCurrentMessage (); if (((currentMessage_disc.authorName == currentUsername_disc) && (config.ADMINSWITCH_AllowUserEditing == true)) || isAdministrator_disc) { var editButton = ASPFHTML.FORM_open (config.getEditPostPagePath ()); editButton += ASPFHTML.INPUT_hidden (config.FORM_FieldMessageID, currentMessage_disc.messageID); editButton += ASPFHTML.INPUT_submit (config.USERTEXT_SHOW_EditPostButton, config.USERTEXT_SHOW_EditPostButton); editButton += ASPFHTML.FORM_close (); editButton.show (); } return; } function showAllThreads_page_disc () { this.showVersion (); this.setCurrentMessage (); var currentThread = new ASPFThread (0); var HTMLout = currentThread.getAllSorted (config.ADMINSWITCH_ViewPostsAscending); HTMLout.show (); delete currentThread; return; } function showCurrentThreadsStatic_page_disc () { this.showVersion (); this.setCurrentMessage (); var currentMessageID = isUndefined_disc (currentMessage_disc) ? 0 : currentMessage_disc.messageID; var currentThread = new ASPFThread (currentMessageID); var HTMLout = currentThread.getCurrentSorted (config.ADMINSWITCH_ViewPostsAscending); HTMLout.show (); delete currentThread; return; } function showCurrentThreads_page_disc () { this.showVersion (); this.setCurrentMessage (); var expandTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewExpand))) ? false : true; var collapseTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewCollapse))) ? false : true; var currentMessageID = isUndefined_disc (currentMessage_disc) ? 0 : currentMessage_disc.messageID; var currentThread = new ASPFThread (currentMessageID); var HTMLout; if ((expandTokensPresent) || (collapseTokensPresent)) { HTMLout = currentThread.getCurrentSorted (config.ADMINSWITCH_ViewPostsAscending); } else { HTMLout = currentThread.getCurrentSortedDHTML (config.ADMINSWITCH_ViewPostsAscending); } HTMLout.show (); delete currentThread; return; } function showNewPostForm_page_disc () { this.showVersion (); var newMessageForm = new ASPFForm (Request.Form); var subject = newMessageForm.getSubject ().unformatFromStoring (); if ((subject != "") && (newMessageForm.getThreadID () != "") && (subject.substring(0, config.USERTEXT_POST_ReplySubjectPrefix.length) != config.USERTEXT_POST_ReplySubjectPrefix)) { newMessageForm.setSubject (config.USERTEXT_POST_ReplySubjectPrefix + subject); } else { newMessageForm.setSubject (subject); } var HTMLout = newMessageForm.getMessageForm (config.getNewPostActionPagePath (), config.USERTEXT_POST_SubmitButton); HTMLout.show (); delete newMessageForm; return; } function showEditPostForm_page_disc () { this.showVersion (); var newMessageForm = new ASPFForm (Request.Form); var dbase = new ASPFDatabase (); var newMessage = dbase.getMessageByID (newMessageForm.getMessageID ()); newMessageForm.setAllFields (newMessage); var HTMLout; if ((newMessageForm.getAuthorName () == currentUsername_disc) || isAdministrator_disc) { HTMLout = newMessageForm.getMessageForm (config.getEditPostActionPagePath (), config.USERTEXT_POST_SaveChangesButton); } else { HTMLout = config.USERTEXT_POST_NotAuthorisedToEditMessage.weak(); } HTMLout.show (); delete newMessageForm; delete dbase; delete newMessage; return; } function showCurrentThread_page_disc () { this.showVersion (); this.setCurrentMessage (); if (isDefined_disc (currentMessage_disc)) { var expandedThread = new ASPFThread (currentMessage_disc.messageID); var HTMLout = expandedThread.getFullThread (currentMessage_disc.threadID); HTMLout.show (); delete expandedThread; } return; } function showArchive_page_disc () { this.showVersion (); this.showArchiveSelector (); this.actionShowArchive (); return; } function showArchiveSelector_page_disc () { var archiveForm = new ASPFForm (Request.QueryString); var HTMLout = archiveForm.getArchiveSelector (); HTMLout.show (); return; } function showAdminSQLForm_page_disc () { this.showVersion (); var HTMLout = ASPFHTML.P_open () + config.USERTEXT_SQL_EnterPrompt + ASPFHTML.P_close (); var adminForm = new ASPFForm (Request.Form); HTMLout += adminForm.getAdminForm (); HTMLout.show (); delete adminForm; return; } function actionSaveNewMessage_page_disc () { var newMessageForm = new ASPFForm (Request.Form); var newMessage = new ASPFMessage (); newMessage.setAllFields (newMessageForm); if (!newMessage.saveAsNewMessage (config.USERTEXT_POST_PostSuccessful, config.USERTEXT_POST_PostFailedPrefix)) { var invalidMessageForm = new ASPFForm (Request.Form); invalidMessageForm.setAllFields (newMessage); var HTMLout = invalidMessageForm.getMessageForm (config.getNewPostActionPagePath (), config.USERTEXT_POST_SubmitButton); HTMLout.show (); delete invalidMessageForm; } currentMessage_disc = newMessage; delete newMessageForm; return; } function actionSaveUpdatedMessage_page_disc () { var newMessageForm = new ASPFForm (Request.Form); var newMessage = new ASPFMessage (); newMessage.setAllFields (newMessageForm); if (!newMessage.saveAsUpdatedMessage (config.USERTEXT_POST_UpdateSuccessful, config.USERTEXT_POST_UpdateFailedPrefix)) { var invalidMessageForm = new ASPFForm (Request.Form); invalidMessageForm.setAllFields (newMessage); var HTMLout = invalidMessageForm.getMessageForm (config.getEditPostActionPagePath (), config.USERTEXT_POST_SaveChangesButton); HTMLout.show (); delete invalidMessageForm; } currentMessage_disc = newMessage; delete newMessageForm; return; } function actionSearch_page_disc () { var searchForm = new ASPFForm (Request.Form); var searchString = searchForm.getSearchString (); if ("" != searchString) { var HTMLout = ""; var dBase = new ASPFDatabase (); var foundMessages = dBase.searchForum (searchString); HTMLout += config.USERTEXT_SEARCH_ResultsHeader1 + (ASPFHTML.QUOTE_open () + searchString + ASPFHTML.QUOTE_close ()).strong(); HTMLout += config.USERTEXT_SEARCH_ResultsHeader2 + String (foundMessages.RecordCount).strong(); if (foundMessages.RecordCount == 0) { HTMLout += config.USERTEXT_SEARCH_ResultsHeaderSuffix0Match + ASPFHTML.BR (); } else { if (foundMessages.RecordCount == 1) { HTMLout += config.USERTEXT_SEARCH_ResultsHeaderSuffix1Match + ASPFHTML.BR (); } else { HTMLout += config.USERTEXT_SEARCH_ResultsHeaderSuffixManyMatches + ASPFHTML.BR (); } } if (!foundMessages.EOF) { var currentMessage; foundMessages.MoveFirst (); HTMLout += ASPFHTML.OL_open (); while (!foundMessages.EOF) { currentMessage = new ASPFMessage (foundMessages); HTMLout += currentMessage.getSummary (); foundMessages.MoveNext (); delete currentMessage; } HTMLout += ASPFHTML.OL_close (); } HTMLout.show(); foundMessages.Close (); delete foundMessages; delete dBase; } delete searchForm; return; } function actionExecuteAdminSQL_page_disc () { var HTMLout = ""; var SQLForm = new ASPFForm (Request.Form); var SQLString = String (SQLForm.getSQLStatement ()); if (SQLString != "") { var dbase = new ASPFDatabase (); var connection = dbase.getOpenDatabaseConnection (); var returnedRecords; returnedRecords = dbase.getAdminSQLResults (connection, SQLString); HTMLout += ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, "100%", "#FFFFFF") + ASPFHTML.TR_open () + ASPFHTML.TD_open (); HTMLout += (config.USERTEXT_SQL_ResultsPrefix + ASPFHTML.prototype.BR ()).strong(); HTMLout += config.USERTEXT_SQL_StatementPrefix.weak() + String (SQLString).strongSmall() + ASPFHTML.prototype.BR (); HTMLout += ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TR_open () + ASPFHTML.TD_open (); HTMLout += this.formatAdminSQLResults (SQLString, returnedRecords); HTMLout += dbase.getConnectionErrors (connection).formatForStoring (); //returnedRecords.close (); HTMLout += ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TABLE_close (); delete dbase; delete returnedRecords; } var messageIDToDelete = String (SQLForm.messageIDToDelete); if (messageIDToDelete != "") { if (0 != Number (messageIDToDelete)) { var deleteDBase = new ASPFDatabase (); deleteDBase.deleteMessageHierarchy (messageIDToDelete).show (); delete deleteDBase; } } var purgeCache = SQLForm.purgeCache; if (purgeCache) { var cache = new ASPFCache (); cache.purge (); delete cache; } HTMLout.show (); delete SQLForm; return; } function actionShowArchive_page_disc () { var archiveForm = new ASPFForm (Request.QueryString); var archiveDate = archiveForm.getArchiveDate (); if (isDefined_disc (archiveDate)) { var expandTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewExpand))) ? false : true; var collapseTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewCollapse))) ? false : true; var currentThread = new ASPFThread (); var HTMLout; if ((expandTokensPresent) || (collapseTokensPresent)) { HTMLout = currentThread.getArchiveSorted (archiveDate, config.ADMINSWITCH_ViewPostsAscending); } else { HTMLout = currentThread.getArchiveSortedDHTML (archiveDate, config.ADMINSWITCH_ViewPostsAscending); } HTMLout.show (); delete currentThread; } return; } // - // Private 'get' routines // function getForumLink_page_disc (textToUse) { return ASPFHTML.A_open (config.getMainPagePreferredPath (), config.ADMINSETTING_ForumName) + textToUse + ASPFHTML.A_close (); } function getParentMessageLink_page_disc (textToUse) { var HTMLout = ""; var messageForm = new ASPFForm (Request.Form); var parentID = messageForm.getParentID (); if (parentID != 0) { HTMLout = ASPFHTML.P_open (); HTMLout += ASPFHTML.A_open (config.getShowMessagePagePath () + "?" + config.FORM_QueryStringMessageID + "=" + parentID, textToUse); HTMLout += textToUse.weak (); HTMLout += ASPFHTML.A_close (); HTMLout += ASPFHTML.P_close (); } delete messageForm; return HTMLout; } function formatAdminSQLResults_page_disc (SQLString, recordSet) { var HTMLout = ""; if (String (SQLString).search(/select/gi) > -1) { HTMLout += ASPFHTML.TABLE_open (2, undefined_disc, "#FFFFFF") + ASPFHTML.TR_open (); var counter; var numRecordFields = recordSet.fields.count - 1; for (counter = 0; counter < numRecordFields; counter++) { HTMLout += ASPFHTML.TH_open (undefined_disc, "left", undefined_disc, true); HTMLout += String (recordSet(counter).name).strong(); HTMLout += ASPFHTML.TH_close (); } HTMLout += ASPFHTML.TR_close (); while (!recordSet.EOF) { HTMLout += ASPFHTML.TR_open (); for (counter = 0; counter < numRecordFields; counter++) { HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, true); HTMLout += recordSet.fields(counter).value; HTMLout += ASPFHTML.TD_close (); } HTMLout += ASPFHTML.TR_close (); recordSet.movenext (); } HTMLout += ASPFHTML.TABLE_close (); } return HTMLout; } function getNewReplyButton_page_disc () { this.setCurrentMessage (); return this.getNewReplyButtonWithTextAndMessage (config.USERTEXT_SHOW_ReplyPostButton, currentMessage_disc); } function getNewReplyButtonWithTextAndMessage_page_disc (buttonText, message) { this.setCurrentMessage (); var HTMLout = ""; if (isDefined_disc (message)) { HTMLout = ASPFHTML.FORM_open (config.getNewPostPagePath ()); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldParentID, message.messageID); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldThreadID, message.threadID); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldSortCode, message.sortCode); HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldSubject, message.subject); HTMLout += ASPFHTML.INPUT_submit (buttonText, buttonText); HTMLout += ASPFHTML.FORM_close (); } return HTMLout; } ASPFPageElement.versionRefOutput = false; ASPFPageElement.showVersion = showVersion_page_disc; ASPFPageElement.setCurrentMessage = setCurrentMessage_page_disc; ASPFPageElement.showStandardMessage = showStandardMessage_page_disc; ASPFPageElement.showForumLink = showForumLink_page_disc; ASPFPageElement.showForumTitle = showForumTitle_page_disc; ASPFPageElement.showMessageSubject = showMessageSubject_page_disc; ASPFPageElement.showMessageBody = showMessageBody_page_disc; ASPFPageElement.showMessageAuthorName = showMessageAuthorName_page_disc; ASPFPageElement.showMessageAuthorEmail = showMessageAuthorEmail_page_disc; ASPFPageElement.showMessageAuthorFullname = showMessageAuthorFullname_page_disc; ASPFPageElement.showMessageDateCreated = showMessageDateCreated_page_disc; ASPFPageElement.showMessageDateModified = showMessageDateModified_page_disc; ASPFPageElement.showMessageSortCode = showMessageSortCode_page_disc; ASPFPageElement.showMessageNumChildren = showMessageNumChildren_page_disc; ASPFPageElement.showMessageID = showMessageID_page_disc; ASPFPageElement.showMessageParentID = showMessageParentID_page_disc; ASPFPageElement.showMessageThreadID = showMessageThreadID_page_disc; ASPFPageElement.showParentMessageLink = showParentMessageLink_page_disc; ASPFPageElement.showSearchForm = showSearchForm_page_disc; ASPFPageElement.showSmallSearchForm = showSmallSearchForm_page_disc; ASPFPageElement.showNewPostButton = showNewPostButton_page_disc; ASPFPageElement.showNewPostLink = showNewPostLink_page_disc; ASPFPageElement.showCurrentMessage = showCurrentMessage_page_disc; ASPFPageElement.showNewReplyButton = showNewReplyButton_page_disc; ASPFPageElement.showEditPostButton = showEditPostButton_page_disc; ASPFPageElement.showAllThreads = showAllThreads_page_disc; ASPFPageElement.showCurrentThreadsStatic = showCurrentThreadsStatic_page_disc; ASPFPageElement.showCurrentThreads = showCurrentThreads_page_disc; ASPFPageElement.showNewPostForm = showNewPostForm_page_disc; ASPFPageElement.showEditPostForm = showEditPostForm_page_disc; ASPFPageElement.showCurrentThread = showCurrentThread_page_disc; ASPFPageElement.showArchive = showArchive_page_disc; ASPFPageElement.showArchiveSelector = showArchiveSelector_page_disc; ASPFPageElement.showAdminSQLForm = showAdminSQLForm_page_disc; ASPFPageElement.actionSaveUpdatedMessage = actionSaveUpdatedMessage_page_disc; ASPFPageElement.actionSaveNewMessage = actionSaveNewMessage_page_disc; ASPFPageElement.actionSearch = actionSearch_page_disc; ASPFPageElement.actionExecuteAdminSQL = actionExecuteAdminSQL_page_disc; ASPFPageElement.actionShowArchive = actionShowArchive_page_disc; ASPFPageElement.getForumLink = getForumLink_page_disc; ASPFPageElement.getParentMessageLink = getParentMessageLink_page_disc; ASPFPageElement.formatAdminSQLResults = formatAdminSQLResults_page_disc; ASPFPageElement.getNewReplyButton = getNewReplyButton_page_disc; ASPFPageElement.getNewReplyButtonWithTextAndMessage = getNewReplyButtonWithTextAndMessage_page_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // STRING OBJECT ADDITIONS // // ====================================================================== // ====================================================================== // // Main object additions. // // ====================================================================== function strong_str_disc () { return ASPFHTML.FONT_open () + ASPFHTML.STRONG_open () + this + ASPFHTML.STRONG_close () + ASPFHTML.FONT_close (); } function strongBig_str_disc () { return ASPFHTML.FONT_open ("+1") + ASPFHTML.STRONG_open () + this + ASPFHTML.STRONG_close () + ASPFHTML.FONT_close (); } function strongSmall_str_disc () { return ASPFHTML.FONT_open ("-1") + ASPFHTML.STRONG_open () + this + ASPFHTML.STRONG_close () + ASPFHTML.FONT_close (); } function weak_str_disc () { return ASPFHTML.FONT_open () + this + ASPFHTML.FONT_close (); } function weakBig_str_disc () { return ASPFHTML.FONT_open ("+1") + this + ASPFHTML.FONT_close (); } function weakSmall_str_disc () { return ASPFHTML.FONT_open ("-1") + this + ASPFHTML.FONT_close (); } function messageBody_str_disc () { return ASPFHTML.BLOCKQUOTE_open () + this + ASPFHTML.BLOCKQUOTE_close (); } function paragraph_str_disc () { return ASPFHTML.P_open () + this + ASPFHTML.P_close (); } function show_str_disc () { Response.Write (this); } function formatForURL_str_disc () { var workingText; workingText = this; workingText = workingText.replace (/\ /gi, "%20"); workingText = workingText.replace (/\\/gi, "/"); return workingText; } function safeFormat_str_disc () { var workingText; workingText = this; workingText = Server.HTMLEncode (workingText); workingText = workingText.replace (/\'/gi, ""); workingText = workingText.replace (/\"/gi, """); workingText = workingText.replace (/\n/gi, " "); workingText = workingText.replace (/\r/gi, " "); return workingText; } function javascriptSafeFormat_str_disc () { var workingText; workingText = this; workingText = workingText.replace (/\"/gi, "\\\""); workingText = workingText.replace (/\n/gi, " "); workingText = workingText.replace (/\r/gi, " "); return workingText; } function HTMLiseLinefeeds_str_disc () { var workingText; workingText = this; workingText = workingText.replace (/\n\n/gi, "</P><P>"); workingText = workingText.replace (/\n/gi, "<BR>"); workingText = workingText.replace (/\r/gi, ""); return workingText; } function purify_str_disc () { var workingText = this; workingText = workingText.replace (/motherfuck/gi, "**********"); workingText = workingText.replace (/fuck/gi, "****"); workingText = workingText.replace (/shit/gi, "****"); workingText = workingText.replace (/cunt/gi, "****"); workingText = workingText.replace (/bastard/gi, "*******"); return workingText; } function formatForStoring_str_disc () { var workingText = this.purify(); workingText = workingText.replace (/\n\n/gi, ASPFHTML.P_open () + ASPFHTML.P_close ()); //workingText = workingText.replace (/\n/gi, ASPFHTML.BR ()); workingText = workingText.removeMaliciousTags (); workingText = workingText.convertComplexTags (); workingText = workingText.fixBrokenTags (); if (!config.ADMINSWITCH_AllowRichFormatting) { workingText = workingText.stripAllTags (); } return workingText; } function unformatFromStoring_str_disc () { var workingText; workingText = this; workingText = workingText.replace (/\<P[^\>]*\>/gi, "\n"); workingText = workingText.replace (/\<\/P[^\>]\>/gi, "\n"); workingText = workingText.replace (/\<BR[^\>]*\>/gi, "\n"); workingText = workingText.replace (/\&\;/gi, "&"); workingText = workingText.replace (/\"/gi, """); return workingText; } function removeMaliciousTags_str_disc () { var workingText = this; workingText = workingText.replace (/\<\s*SCRIPT[^\\>]*\>/gi, " "); workingText = workingText.replace (/\<\s*META[^\\>]*\>/gi, " "); workingText = workingText.replace (/\<\s*\/?\s*BODY[^\\>]*\>/gi, " "); workingText = workingText.replace (/\<\s*\/?\s*HTML[^\\>]*\>/gi, " "); var JSEvents = new RegExp ("\\<[^\\>]*(" + config.SYS_AllJavascriptEvents + ")[^\\>]*\\>", "gi"); workingText = workingText.replace (JSEvents, " "); return workingText; } function fixBrokenTags_str_disc (textToClean) { var workingText = this; workingText = workingText.fixTag ("b"); workingText = workingText.fixTag ("i"); workingText = workingText.fixTag ("u"); workingText = workingText.fixTag ("ul"); workingText = workingText.fixTag ("ol"); workingText = workingText.fixTag ("font"); workingText = workingText.fixTag ("h1"); workingText = workingText.fixTag ("h2"); workingText = workingText.fixTag ("h3"); workingText = workingText.fixTag ("h4"); workingText = workingText.fixTag ("h5"); workingText = workingText.fixTag ("h6"); workingText = workingText.fixTag ("table"); workingText = workingText.fixTag ("tr"); workingText = workingText.fixTag ("th"); workingText = workingText.fixTag ("td"); return workingText; } function fixTag_str_disc (tag) { var openTag = new RegExp ("\<" + tag + "\>", "gi"); var closeTag = new RegExp ("\\<\\s*\\/\\s*" + tag + "[^a-zA-Z0-9][^\\>]*\\>", "gi"); var tagDifference = this.countTags (openTag) - this.countTags (closeTag); var additionalTags = ""; if (tagDifference > 0) { for (counter = 0; counter < tagDifference; counter++) { additionalTags += "</" + tag + " HTMLFixup>"; } } delete openTag; delete closeTag; return this + additionalTags; } function countTags_str_disc (tag) { var counter = 0; var workingText = this; var foundAt = workingText.search (tag); while (foundAt != -1) { counter += 1; workingText = workingText.substr (foundAt + 1, workingText.length - foundAt + 1); foundAt = workingText.search (tag); } return counter; } function convertComplexTags_str_disc () { var workingText = this; var newText = ""; var startAt = workingText.search ("<"); var endAt = workingText.search (">") + 1; var linkAt = workingText.search (this.PROTOCOLS_RX_DISC); this.inLink = false; while ((startAt != -1) || (linkAt != -1)) { if (((linkAt < startAt) || (startAt == -1)) && (linkAt >= 0) && (!this.inLink)) { newText += workingText.substring (0, linkAt); var URL = workingText.substr (linkAt); var URLEnd = new RegExp (this.END_OF_URL_RX_DISC, "gi"); endAt = URL.search (URLEnd); var linkText = workingText.substring (linkAt, endAt); linkText = linkText.stripAllTags (); linkText = linkText.protocolise (); newText += ASPFHTML.A_open (linkText, config.USERTEXT_STRING_WarningUnverifiedLink) + linkText + ASPFHTML.A_close (); workingText = URL.substr (endAt); } else { newText += workingText.substring (0, startAt); newText += workingText.substring (startAt, endAt).sanitiseTag (); workingText = workingText.substr (endAt); } startAt = workingText.search ("<"); endAt = workingText.search (">") + 1; linkAt = workingText.search (this.PROTOCOLS_RX_DISC); } return newText + workingText; } function sanitiseTag_str_disc () { var tag = new ASPFHTML (this); if (tag.isLinkOpen ()) { this.inLink = true; } else if (tag.isLinkClose ()) { this.inLink = false; } return tag.sanitise (); } function getAttribute_str_disc (attributeName) { var attributeValue; var attribRX = new RegExp (attributeName + "\s*=\s*", "i"); var foundAt = this.search (attribRX); if (foundAt > -1) { var subtag = this.substr (foundAt); var tagStart = subtag.search ("="); subtag = subtag.substr (tagStart + 1); var charCount = 0; while ((charCount < subtag.length) && (subtag.charAt (charCount) == " ")) { charCount++; } var quoted = false; var quoteUsed = ""; if ((subtag.charAt (charCount) == "\"") || (subtag.charAt (charCount) == "'")) { quoted = true; quoteUsed = subtag.charAt (charCount); charCount += 1 } subtag = subtag.substr (charCount); var attribEndMarker = "\\s"; if (quoted == true) { attribEndMarker = quoteUsed; } var attribEnd = subtag.search (attribEndMarker); attributeValue = subtag.substr (0, attribEnd); if (attributeValue == "") { attributeValue = undefined_disc; } } return attributeValue; } function protocolise_str_disc () { var protocolisedVersion = ""; var protocol = this.substr (0, this.indexOf ("//")); switch (protocol) { case "http:": case "ftp:": case "https:": case "gopher:": case "file:": protocolisedVersion = this; break; default: protocolisedVersion = "http://" + this; break; } return protocolisedVersion; } function precis_str_disc () { var precisString = this; if (precisString.length > config.ADMINSETTING_PrecisLength) { precisString = precisString.substr(0, config.ADMINSETTING_PrecisLength) + config.USERTEXT_STRING_StringTruncatedSuffix; } precisString = precisString.replace (/\<P.*\>/gi, " "); precisString = precisString.replace (/\<\/P[^\\>]*\>/gi, " "); precisString = precisString.replace (/\<BR[^\\>]*\>/gi, " "); precisString = precisString.replace (/\<BLOCKQUOTE.*\>/gi, " "); precisString = precisString.replace (/\<\/BLOCKQUOTE.*\>/gi, " "); if (precisString.lastIndexOf (">") < precisString.lastIndexOf ("<")) { precisString = precisString.substr (0, precisString.lastIndexOf ("<")); } return precisString; } function stripAllTags_str_disc () { return this.replace (/\<.*\>/gi, " "); } String.prototype.PROTOCOLS_RX_DISC = "(http://)|(www\\.)|(ftp://)|(https://)|(gopher://)|(file://)|(mailto:)|(news:)|(telnet:)|(wais:)"; String.prototype.END_OF_URL_RX_DISC = "[^A-Za-z0-9\.:;,=@_&\\/\\?\\+\\$\\{\\}\\\"]"; String.prototype.strong = strong_str_disc; String.prototype.strongBig = strongBig_str_disc; String.prototype.strongSmall = strongSmall_str_disc; String.prototype.weak = weak_str_disc; String.prototype.weakBig = weakBig_str_disc; String.prototype.weakSmall = weakSmall_str_disc; String.prototype.messageBody = messageBody_str_disc; String.prototype.paragraph = paragraph_str_disc; String.prototype.show = show_str_disc; String.prototype.formatForURL = formatForURL_str_disc; String.prototype.safeFormat = safeFormat_str_disc; String.prototype.javascriptSafeFormat = javascriptSafeFormat_str_disc; String.prototype.HTMLiseLinefeeds = HTMLiseLinefeeds_str_disc; String.prototype.purify = purify_str_disc; String.prototype.formatForStoring = formatForStoring_str_disc; String.prototype.unformatFromStoring = unformatFromStoring_str_disc; String.prototype.removeMaliciousTags = removeMaliciousTags_str_disc; String.prototype.fixBrokenTags = fixBrokenTags_str_disc; String.prototype.fixTag = fixTag_str_disc; String.prototype.countTags = countTags_str_disc; String.prototype.convertComplexTags = convertComplexTags_str_disc; String.prototype.sanitiseTag = sanitiseTag_str_disc; String.prototype.getAttribute = getAttribute_str_disc; String.prototype.protocolise = protocolise_str_disc; String.prototype.precis = precis_str_disc; String.prototype.stripAllTags = stripAllTags_str_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // TEXTCONTROL OBJECT // // ====================================================================== function ASPFTextControl (name, contents, formName) { this.controlName = name; if (isDefined_disc (contents)) { this.contents = contents; } else { this.contents = ""; } if (isDefined_disc (formName)) { this.formName = formName; } else { this.formName = "ASPF"; } return this; } function isUsed_txt_disc () { return ASPFTextControl.initialised; } function getImageLoader_txt_disc () { var JSout = ASPFHTML.JS_open (); JSout += "var buttonImage_normal = new Image ();\n"; JSout += "buttonImage_normal.src = \"" + config.ADMINSETTING_ToolbarButtonImagePathname + "\";\n"; JSout += "var buttonImage_up = new Image ();\n"; JSout += "buttonImage_up.src = \"" + config.ADMINSETTING_ToolbarButtonImageUpPathname + "\";\n"; JSout += "var buttonImage_down = new Image ();\n"; JSout += "buttonImage_down.src = \"" + config.ADMINSETTING_ToolbarButtonImageDownPathname + "\";\n\n"; JSout += ASPFHTML.JS_close (); return JSout; } function getGenericRoutines_txt_disc () { var JSout = ASPFHTML.JS_open (); JSout += "function flipImage_disc (imageTagName, newImageObject)\n"; JSout += "{\n"; JSout += "\tif (document.images)\n"; JSout += "\t{\n"; JSout += "\t\tdocument [imageTagName].src = newImageObject.src;\n"; JSout += "\t}\n\n"; JSout += "\treturn;\n"; JSout += "}\n\n"; JSout += ASPFHTML.JS_close (); return JSout; } function getControlSpecificRoutines_txt_disc (controlName) { var JSout = ASPFHTML.JS_open (); JSout += "function submitRecord ()\n"; JSout += "{\n"; JSout += "\tvar text = frames." + controlName + ".document.body.innerText;\n"; JSout += "\tvar html = frames." + controlName + ".document.body.innerHTML;\n"; JSout += "\tif ((html == \"\") || (text == \"\"))\n"; JSout += "\t{\n"; JSout += "\t\tframes." + controlName + ".focus();\n"; JSout += "\t\talert (\"Body field must not be empty.\");\n"; JSout += "\t\treturn;\n"; JSout += "\t}\n"; JSout += "\tdocument." + this.formName + "." + controlName + ".value = html;\n"; JSout += "\tdocument." + this.formName + ".submit();\n"; JSout += "\treturn;\n"; JSout += "}\n\n"; JSout += "function setStyle_" + controlName + " (newStyle)\n"; JSout += "{\n"; JSout += "\tvar selection = frames." + controlName + ".document.selection.createRange ();\n"; JSout += "\tselection.execCommand (newStyle);\n"; JSout += "\tframes." + controlName + ".focus();\n"; JSout += "\treturn;\n"; JSout += "}\n\n"; JSout += "function setFont_" + controlName + " ()\n"; JSout += "{\n"; JSout += "\tvar selectedRange = frames." + controlName + ".document.selection.createRange ();\n"; JSout += "\tselectedRange.execCommand (\"FontName\", true, document." + this.formName + ".FontName.options [document." + this.formName + ".FontName.selectedIndex].value);\n"; JSout += "\tselectedRange.execCommand (\"FontSize\", true, document." + this.formName + ".FontSize.options [document." + this.formName + ".FontSize.selectedIndex].value);\n"; JSout += "\tselectedRange.select ();\n"; JSout += "\tframes." + controlName + ".focus();\n"; JSout += "\treturn;\n"; JSout += "}\n\n"; JSout += ASPFHTML.JS_close (); return JSout; } function getImageControlHTML_txt_disc (control, name, command, title, pathname, width, height) { var HTMLout = ""; HTMLout += "<IMG ALT=\"" + name + "\" HEIGHT=\"" + height + "\" WIDTH=\"" + width; HTMLout += "\" NAME=\"" + title + "\" SRC=\"" + pathname + "\" onclick=\"flipImage_disc ('" + title + "', '" + title; HTMLout += "Image_down'); setStyle_" + control + " ('" + command + "'); return false;\" onmouseover=\"flipImage_disc ('"; HTMLout += title + "', '" + title + "Image_up');\" onmouseout=\"flipImage_disc ('" + title + "', '" + title + "Image_normal');\">"; return HTMLout; } function getControlActivator_txt_disc (controlName) { var HTMLout = ""; HTMLout += ASPFHTML.JS_open (); HTMLout += "var editControl = frames." + controlName + ".document;\n"; HTMLout += "editControl.designMode = \"On\";\n"; if (isDefined_disc (this.contents) && (this.contents != "")) { HTMLout += "editControl.write (\"" + this.contents.javascriptSafeFormat () + "\");\n"; } HTMLout += ASPFHTML.JS_close (); return HTMLout; } function getToolbarButtonControl_txt_disc (controlName, buttonName, buttonTitle, buttonAction) { return ASPFHTML.IMG (config.ADMINSETTING_ToolbarButtonImagePathname, buttonTitle, 0, config.ADMINSETTING_ToolbarButtonImageWidth, config.ADMINSETTING_ToolbarButtonImageHeight, buttonName, buttonName, undefined_disc, "flipImage_disc ('" + buttonName + "', buttonImage_up)", "flipImage_disc ('" + buttonName + "', buttonImage_normal)", "flipImage_disc ('" + buttonName + "', buttonImage_down); setStyle_" + controlName + " ('" + buttonAction + "'); return false;", "flipImage_disc ('" + buttonName + "', buttonImage_up); return false;"); } function getToolbarSpacer_txt_disc () { return ASPFHTML.IMG (config.ADMINSETTING_ToolbarSpacerImagePathname, " ", 0, config.ADMINSETTING_ToolbarSpacerImageWidth, config.ADMINSETTING_ToolbarSpacerImageHeight); } function getToolbarButtons_txt_disc (controlName) { var HTMLout = ASPFHTML.TABLE_open (0, 300, undefined_disc, undefined_disc, 0, 0); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (5); HTMLout += this.getToolbarSpacer (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "bold", "Bold", "bold"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "italic", "Italic", "italic"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "underline", "Underline", "underline"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarSpacer (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "justifyleft", "Left", "JustifyLeft"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "justifycenter", "Centre", "JustifyCenter"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "justifyright", "Right", "JustifyRight"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "justifyfull", "Justify", "JustifyFull"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (5); HTMLout += this.getToolbarSpacer (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "bulleted", "Bulleted List", "InsertUnorderedList"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "numbered", "Numbered List", "InsertOrderedList"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (5); HTMLout += this.getToolbarSpacer (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "indent", "Indent", "Indent"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth); HTMLout += this.getToolbarButtonControl (controlName, "outdent", "outdent", "Outdent"); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (5); HTMLout += this.getToolbarSpacer (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TABLE_close (); return HTMLout; } function getControlHTML_txt_disc (controlName) { var controlWidth = 9 * config.ADMINSETTING_TextAreaCols; var controlHeight = 20 * config.ADMINSETTING_TextAreaRows; var HTMLout = ASPFHTML.TABLE_open (0, controlWidth, config.ADMINSETTING_ToolbarBackgroundColour, undefined_disc, 0, 0); HTMLout += ASPFHTML.TR_open (); HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarTotalWidth, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, config.ADMINSETTING_ToolbarImagePathname); HTMLout += this.getToolbarButtons (controlName); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TD_open (controlWidth - config.ADMINSETTING_ToolbarTotalWidth); HTMLout += ASPFHTML.SELECT_open ("FontName", "setFont_" + controlName + " (); return false;"); HTMLout += ASPFHTML.OPTION ("Courier, Century") + "Courier"; HTMLout += ASPFHTML.OPTION ("Helvetica, Arial, sans serif") + "Helvetica"; HTMLout += ASPFHTML.OPTION ("Times New Roman, serif", true) + "Times"; HTMLout += ASPFHTML.SELECT_close (); HTMLout += ASPFHTML.SELECT_open ("FontSize", "setFont_" + controlName + " (); return false;"); HTMLout += ASPFHTML.OPTION ("1") + "8pt"; HTMLout += ASPFHTML.OPTION ("2") + "10pt"; HTMLout += ASPFHTML.OPTION ("3", true) + "12pt"; HTMLout += ASPFHTML.OPTION ("4") + "14pt"; HTMLout += ASPFHTML.OPTION ("5") + "18pt"; HTMLout += ASPFHTML.OPTION ("6") + "24pt"; HTMLout += ASPFHTML.OPTION ("7") + "36pt"; HTMLout += ASPFHTML.SELECT_close (); HTMLout += ASPFHTML.TD_close (); HTMLout += ASPFHTML.TR_close (); HTMLout += ASPFHTML.TABLE_close (); HTMLout += ASPFHTML.IFRAME_open (controlName, controlName, controlWidth, controlHeight); HTMLout += ASPFHTML.IFRAME_close (); HTMLout += ASPFHTML.BR (); HTMLout += ASPFHTML.INPUT_hidden (controlName, ""); return HTMLout; } function isRichTextCapable_txt_disc () { var clientCanHandleIt; if ((String (Request.ServerVariables ("HTTP_USER_AGENT")).indexOf ("MSIE 4") > 0) || (String (Request.ServerVariables ("HTTP_USER_AGENT")).indexOf ("MSIE 5") > 0)) { clientCanHandleIt = true; } else { clientCanHandleIt = false; } return clientCanHandleIt; } function getControl_txt_disc () { var HTMLout; if (this.isRichTextCapable ()) { ASPFTextControl.initialised = true; HTMLout = this.getImageLoader (); HTMLout += this.getGenericRoutines (); HTMLout += this.getControlSpecificRoutines (this.controlName); HTMLout += this.getControlHTML (this.controlName); HTMLout += this.getControlActivator (this.controlName); } else { ASPFTextControl.initialised = false; HTMLout = ASPFHTML.TEXTAREA_open (this.controlName, config.ADMINSETTING_TextAreaCols, config.ADMINSETTING_TextAreaRows) + this.contents.unformatFromStoring () + ASPFHTML.TEXTAREA_close (); } return HTMLout; } function getControlContents_txt_disc (formData, controlName) { var contents; if (this.isRichTextCapable ()) { contents = formData (controlName); } else { contents = String (formData (controlName)).HTMLiseLinefeeds (); } return contents; } ASPFTextControl.initialised = false; ASPFTextControl.isUsed = isUsed_txt_disc; ASPFTextControl.isRichTextCapable = isRichTextCapable_txt_disc; ASPFTextControl.getControlContents = getControlContents_txt_disc; ASPFTextControl.prototype.isUsed = isUsed_txt_disc; ASPFTextControl.prototype.getImageLoader = getImageLoader_txt_disc; ASPFTextControl.prototype.getGenericRoutines = getGenericRoutines_txt_disc; ASPFTextControl.prototype.getControlSpecificRoutines = getControlSpecificRoutines_txt_disc; ASPFTextControl.prototype.getImageControlHTML = getImageControlHTML_txt_disc; ASPFTextControl.prototype.getControlActivator = getControlActivator_txt_disc; ASPFTextControl.prototype.getToolbarButtonControl = getToolbarButtonControl_txt_disc; ASPFTextControl.prototype.getToolbarSpacer = getToolbarSpacer_txt_disc; ASPFTextControl.prototype.getToolbarButtons = getToolbarButtons_txt_disc; ASPFTextControl.prototype.getControlHTML = getControlHTML_txt_disc; ASPFTextControl.prototype.getControl = getControl_txt_disc; ASPFTextControl.prototype.isRichTextCapable = isRichTextCapable_txt_disc; ASPFTextControl.prototype.getControlContents = getControlContents_txt_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // THREAD OBJECT // // ====================================================================== function ASPFThread (currentMessageID, pageURLToUse) { this.currentMessageID = currentMessageID; if (isUndefined_disc (pageURLToUse)) { this.pageURLToUse = config.getMainPagePath (); } else { this.pageURLToUse = pageURLToUse; } return this; } // ====================================================================== // // Interface to private member variables. // // ====================================================================== function getCurrentMessageID_thd_disc () { return this.currentMessageID; } function setCurrentMessageID_thd_disc (newCurrentMessageID) { this.currentMessageID = newCurrentMessageID; return; } // ====================================================================== // // Main object methods. // // ====================================================================== function getAllSorted_thd_disc (sortAscending) { var dbase = new ASPFDatabase (); var messages = dbase.getAllRootMessages(sortAscending); var messageView = new ASPFView (messages, this.currentMessageID); var threadInfo = messageView.getView (); delete dbase; delete messages; delete messageView; return threadInfo; } function getCurrentSorted_thd_disc (sortAscending) { var dbase = new ASPFDatabase (); var messages = dbase.getCurrentRootMessages (sortAscending); var messageView = new ASPFView (messages, this.currentMessageID); var threadInfo = messageView.getView (); delete dbase; delete messages; delete messageView; return threadInfo; } function getCurrentSortedDHTML_thd_disc (sortAscending) { var dbase = new ASPFDatabase (); var messages = dbase.getAllCurrentMessages (sortAscending); var messageView = new ASPFView (messages, this.currentMessageID); var threadInfo = messageView.getDHTMLView (); delete dbase; delete messages; delete messageView; return threadInfo; } function getArchiveSorted_thd_disc (archiveDate, sortAscending) { var dbase = new ASPFDatabase (); var messages = dbase.getArchiveRootMessages (archiveDate, sortAscending); var messageView = new ASPFView (messages, this.currentMessageID, config.getArchivePagePath ()); var threadInfo = messageView.getView (); delete dbase; delete messages; delete messageView; return threadInfo; } function getArchiveSortedDHTML_thd_disc (archiveDate, sortAscending) { var dbase = new ASPFDatabase (); var messages = dbase.getAllArchiveMessages (archiveDate, sortAscending); var messageView = new ASPFView (messages, this.currentMessageID, config.getArchivePagePath ()); var threadInfo = messageView.getDHTMLView (); delete dbase; delete messages; delete messageView; return threadInfo; } function getExpandedThread_thd_disc (threadID, startAt) { var dbase = new ASPFDatabase (); var messages = dbase.getSubThreadMessages (threadID, startAt); var messageView = new ASPFView (messages, this.currentMessageID, this.pageURLToUse); var expandedThread = messageView.getViewThread (); delete dbase; delete messages; delete messageView; return expandedThread; } function getSubThread_thd_disc (threadID, startAt) { var dbase = new ASPFDatabase (); var messages = dbase.getSubThreadMessages (threadID, startAt); var messageView = new ASPFView (messages, this.currentMessageID); var subThread = messageView.getViewFullThread (); delete dbase; delete messages; delete messageView; return subThread; } function getFullThread_thd_disc (threadID) { var dbase = new ASPFDatabase (); var messages = dbase.getAllThreadMessages (threadID); var messageView = new ASPFView (messages, this.currentMessageID); var threadLayout = messageView.getViewFullThread (); delete dbase; delete messages; delete messageView; return threadLayout; } ASPFThread.prototype.getCurrentMessageID = getCurrentMessageID_thd_disc; ASPFThread.prototype.setCurrentMessageID = setCurrentMessageID_thd_disc; ASPFThread.prototype.getAllSorted = getAllSorted_thd_disc; ASPFThread.prototype.getCurrentSorted = getCurrentSorted_thd_disc; ASPFThread.prototype.getCurrentSortedDHTML = getCurrentSortedDHTML_thd_disc; ASPFThread.prototype.getArchiveSorted = getArchiveSorted_thd_disc; ASPFThread.prototype.getArchiveSortedDHTML = getArchiveSortedDHTML_thd_disc; ASPFThread.prototype.getExpandedThread = getExpandedThread_thd_disc; ASPFThread.prototype.getSubThread = getSubThread_thd_disc; ASPFThread.prototype.getFullThread = getFullThread_thd_disc; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" RUNAT="Server"> //======================================================================= // // "ASP Forums" - a web-based discussion forum implementation. // Copyright (C) 1999, 2000 ASP Forums, http://www.aspforums.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //======================================================================= //======================================================================= // ASP Forums version 2.0 beta 2 - July 20th 2000. //======================================================================= // ====================================================================== // // VIEW OBJECT // // ====================================================================== function ASPFView (messages, currentMessageID, pageURLToUse) { this.messages = messages; this.currentMessageID = currentMessageID; if (isUndefined_disc (pageURLToUse)) { this.pageURLToUse = config.getMainPagePath (); } else { this.pageURLToUse = pageURLToUse; } return this; } // ====================================================================== // // Interface to private member variables. // // ====================================================================== function getMessageList_vw_disc () { return this.messages; } function setMessageList_vw_disc (newMessageList) { this.messages = newMessageList; return; } function getCurrentMessageID_vw_disc () { return this.currentMessageID; } function setCurrentMessageID_vw_disc (newCurrentMessageID) { this.currentMessageID = newCurrentMessageID; return; } // ====================================================================== // // Main object methods. // // ====================================================================== function getView_vw_disc () { if (this.messages.EOF) { return String (config.USERTEXT_VIEW_NoMessages).weak(); } this.messages.MoveFirst(); var currentMessage; var viewLine; var view = ""; var viewCounter = 0; var showMaxRecords; if (config.ADMINSETTING_StaticViewShowAtMostNRecords > 0) { showMaxRecords = config.ADMINSETTING_StaticViewShowAtMostNRecords; } else { showMaxRecords = this.messages.RecordCount; } while ((!this.messages.EOF) && (viewCounter < showMaxRecords)) { viewCounter += 1; currentMessage = new ASPFMessage (this.messages); var expandCollapse = new ASPFExpandCollapse (currentMessage, viewCounter, currentMessage.getMessageID (), 0, this.pageURLToUse); if (expandCollapse.doWeExpand()) { var expandedThread = new ASPFThread (this.currentMessageID, this.pageURLToUse); view += expandedThread.getExpandedThread (currentMessage.getThreadID (), currentMessage.getSortCode ()); delete expandedThread; } else { viewLine = currentMessage.getExpandCollapse (viewCounter, 1, this.pageURLToUse) + currentMessage.getViewEntry (this.currentMessageID); view += this.getIndented (1, viewLine); } delete currentMessage; delete expandCollapse; this.messages.MoveNext(); } return view; } function getDHTMLView_vw_disc () { if (this.messages.EOF) { return String (config.USERTEXT_VIEW_NoMessages).weak(); } this.messages.MoveFirst(); var view = this.getDHTMLExpandCollapseCode (); while (!this.messages.EOF) { view += this.getDHTMLThread (this.messages); } return view; } function getDHTMLThread_vw_disc (messages) { var relativeIndentLevel; var absoluteIndentLevel; var sortCode; var currentMessage; var subjectLine; relativeIndentLevel = 1; currentMessage = new ASPFMessage (messages); absoluteIndentLevel = this.getSortcodeIndentLevel (currentMessage.getSortCode ()); sortCode = currentMessage.getSortCode (); subjectLine = currentMessage.getDHTMLExpandCollapse (relativeIndentLevel, this.pageURLToUse) + currentMessage.getViewEntry (0); var currentID = String (currentMessage.getMessageID ()); var currentSortCode = String (currentMessage.getSortCode ()); delete currentMessage; return this.getIndented (relativeIndentLevel, subjectLine) + this.getDHTMLChildren (currentID, currentSortCode, absoluteIndentLevel, relativeIndentLevel, sortCode, messages); } function getDHTMLChildren_vw_disc (previousID, previousSortCode, absoluteIndentLevel, relativeIndentLevel, workingSortCode, messages) { var viewLine = ""; var displaySubthread = ""; messages.MoveNext () var nextMessage = new ASPFMessage (messages); if (previousSortCode == nextMessage.getSortCode ().substring (0, previousSortCode.length)) { if (previousSortCode == nextMessage.getSortCode ().substring (0, previousSortCode.length)) { absoluteIndentLevel++; relativeIndentLevel++; } if (relativeIndentLevel == 2) { displaySubthread = "none"; } else { displaySubthread = ""; } viewLine += ASPFHTML.DIV_open ("Subthread-" + previousID, "margin-left:0;display:" + displaySubthread + ";"); var messageOutputCounter = 0; while (!messages.EOF && (previousSortCode == nextMessage.getSortCode ().substring (0, previousSortCode.length))) { subjectLine = nextMessage.getDHTMLExpandCollapse (relativeIndentLevel, this.pageURLToUse) + nextMessage.getViewEntry (0); viewLine += this.getIndented (relativeIndentLevel, subjectLine); viewLine += this.getDHTMLChildren (String (nextMessage.getMessageID ()), nextMessage.getSortCode (), absoluteIndentLevel, relativeIndentLevel, nextMessage.getSortCode (), messages); delete nextMessage; nextMessage = new ASPFMessage (messages); messageOutputCounter++; } viewLine += ASPFHTML.DIV_close (); } delete nextMessage; return viewLine; } function getViewThread_vw_disc () { if (this.messages.EOF) { return String (config.USERTEXT_VIEW_NoMessages).weak(); } this.messages.MoveFirst(); var lastIndentLevel; var currentIndentLevel; var viewLine; var firstMessageSortCode; var thread = ""; var viewCounter = 0; lastIndentLevel = 0; var dBase = new ASPFDatabase (); firstMessageSortCode = String (dBase.getSortCodeField (this.messages)); while (!this.messages.EOF) { viewCounter += 1; var currentMessage = new ASPFMessage (this.messages); var expandCollapseThread = new ASPFExpandCollapse (currentMessage, viewCounter, 0, 0, this.pageURLToUse); currentIndentLevel = 1 + this.getIndentLevel () - this.getSortcodeIndentLevel (firstMessageSortCode); if (currentIndentLevel < 1) { currentIndentLevel = 1; firstMessageSortCode = String (dBase.getSortCodeField (this.messages)); } viewLine = currentMessage.getExpandCollapse (viewCounter, 0, this.pageURLToUse) + currentMessage.getViewEntry (this.currentMessageID); thread += this.getIndented (currentIndentLevel, viewLine); if (expandCollapseThread.doWeCollapse()) { this.skipToNextSibling (); if (!this.messages.EOF) { firstMessageSortCode = this.getParentSortCode (String (dBase.getSortCodeField (this.messages))); } } else { if (!this.messages.EOF) { this.messages.MoveNext(); } } delete currentMessage; delete expandCollapseThread; } delete dbase; return thread; } function getParentSortCode_vw_disc (sortcode) { var parentSortCode = ""; var lastSeparator = sortcode.lastIndexOf ("."); if (-1 != lastSeparator) { parentSortCode = sortcode.substring (0, lastSeparator); } return parentSortCode; } function getViewFullThread_vw_disc () { if (this.messages.EOF) { return String (config.USERTEXT_VIEW_NoMessages).weak(); } this.messages.MoveFirst(); var lastIndentLevel; var currentIndentLevel; var viewLine; var firstMessageSortCode; var fullThread = ""; lastIndentLevel = 0; var dBase = new ASPFDatabase (); firstMessageSortCode = String (dBase.getSortCodeField (this.messages)); while (!this.messages.EOF) { var currentMessage = new ASPFMessage (this.messages); currentIndentLevel = this.getIndentLevel (); viewLine = currentMessage.getViewEntry (this.currentMessageID); fullThread += this.getIndented (currentIndentLevel, viewLine); if (!this.messages.EOF) { this.messages.MoveNext(); } delete currentMessage; } delete dBase; return fullThread; } function getIndented_vw_disc (currentIndentLevel, viewText) { var counter; var HTMLOutput; var tableWidth; HTMLOutput = ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, undefined_disc, undefined_disc, undefined_disc, "0", "0") + ASPFHTML.TR_open () + ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, "top") + ASPFHTML.NBSP (); for (counter = 0; counter < currentIndentLevel; counter++) { HTMLOutput += ASPFHTML.NBSP_multi (config.ADMINSETTING_ViewIndentResponseSpaces); } HTMLOutput += ASPFHTML.TD_close () + ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, "top") + viewText + ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TABLE_close (); return HTMLOutput; } function getIndentLevel_vw_disc () { var parsedCode = new ASPFMessage (this.messages).sortCode; var foundAt = 1; var indentCounter = 0; while (foundAt > 0) { foundAt = String (parsedCode).search ("[\\.]"); parsedCode = String (parsedCode).substr (foundAt + 1); indentCounter++; } delete parsedCode; return indentCounter; } function getSortcodeIndentLevel_vw_disc (sortCode) { var parsedCode = sortCode; var foundAt = 1; var indentCounter = 0; while (foundAt > 0) { foundAt = String (parsedCode).search ("[^0-9]"); parsedCode = String (parsedCode).substr (foundAt + 1); indentCounter++; } return indentCounter; } function skipToNextSibling_vw_disc () { var currentMessage = new ASPFMessage (this.messages); var currentSortCode = currentMessage.getSortCode (); this.messages.MoveNext(); while ((!this.messages.EOF) && (String(currentSortCode).length < String(new ASPFMessage(this.messages).sortCode).length)) { this.messages.MoveNext(); } delete currentMessage; return; } function getDHTMLExpandCollapseCode_vw_disc () { var DHTMLCode = ""; DHTMLCode += "\n<SCR" + "IPT LANGUAGE=\"Javascript\" RUNAT=\"client\">"; DHTMLCode += "\nvar standardDOM;"; DHTMLCode += "\nif (document.all)"; DHTMLCode += "\n{"; DHTMLCode += "\n\tstandardDOM = false;"; DHTMLCode += "\n}"; DHTMLCode += "\nelse"; DHTMLCode += "\n{"; DHTMLCode += "\n\tdocument.all = document.getElementById;"; DHTMLCode += "\n\tstandardDOM = true;"; DHTMLCode += "\n}\n"; DHTMLCode += "\nfunction expandCollapseForumClick_disc (DOMEvent)"; DHTMLCode += "\n{"; DHTMLCode += "\n\tvar parentID;"; DHTMLCode += "\n\tvar child;"; DHTMLCode += "\n\tvar parentImage;"; DHTMLCode += "\n\tif (standardDOM)"; DHTMLCode += "\n\t{"; DHTMLCode += "\n\t\tparentID = DOMEvent.target.id;"; DHTMLCode += "\n\t}"; DHTMLCode += "\n\telse"; DHTMLCode += "\n\t{"; DHTMLCode += "\n\t\tparentID = window.event.srcElement.id;"; DHTMLCode += "\n\t}"; DHTMLCode += "\n\tchild = document.all (\"Subthread-\" + parentID);"; DHTMLCode += "\n\tif (child != null)"; DHTMLCode += "\n\t{"; DHTMLCode += "\n\t\tparentImage = document.all (parentID);"; DHTMLCode += "\n\t\tif (child.style.display == \"none\")"; DHTMLCode += "\n\t\t{"; DHTMLCode += "\n\t\t\tchild.style.display = \"block\";"; DHTMLCode += "\n\t\t\tparentImage.src = \"" + config.ADMINSETTING_CollapseImagePathname + "\";"; DHTMLCode += "\n\t\t\tparentImage.alt = \"" + config.USERTEXT_VIEW_PopupCollapseLink + "\";"; DHTMLCode += "\n\t\t}"; DHTMLCode += "\n\t\telse"; DHTMLCode += "\n\t\t{"; DHTMLCode += "\n\t\t\tchild.style.display = \"none\";"; DHTMLCode += "\n\t\t\tparentImage.src = \"" + config.ADMINSETTING_ExpandImagePathname + "\";"; DHTMLCode += "\n\t\t\tparentImage.alt = \"" + config.USERTEXT_VIEW_PopupExpandLink + "\";"; DHTMLCode += "\n\t\t}"; DHTMLCode += "\n\t}"; DHTMLCode += "\n\treturn true;"; DHTMLCode += "\n}"; DHTMLCode += "\n</SCR" + "IPT>"; return DHTMLCode; } ASPFView.prototype.getMessageList = getMessageList_vw_disc; ASPFView.prototype.setMessageList = setMessageList_vw_disc; ASPFView.prototype.getCurrentMessageID = getCurrentMessageID_vw_disc; ASPFView.prototype.setCurrentMessageID = setCurrentMessageID_vw_disc; ASPFView.prototype.getView = getView_vw_disc; ASPFView.prototype.getDHTMLView = getDHTMLView_vw_disc; ASPFView.prototype.getDHTMLThread = getDHTMLThread_vw_disc; ASPFView.prototype.getDHTMLChildren = getDHTMLChildren_vw_disc; ASPFView.prototype.getViewThread = getViewThread_vw_disc; ASPFView.prototype.getParentSortCode = getParentSortCode_vw_disc; ASPFView.prototype.getViewFullThread = getViewFullThread_vw_disc; ASPFView.prototype.getIndented = getIndented_vw_disc; ASPFView.prototype.getIndentLevel = getIndentLevel_vw_disc; ASPFView.prototype.getSortcodeIndentLevel = getSortcodeIndentLevel_vw_disc; ASPFView.prototype.skipToNextSibling = skipToNextSibling_vw_disc; ASPFView.prototype.getDHTMLExpandCollapseCode = getDHTMLExpandCollapseCode_vw_disc; </SCRIPT>