home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 December / december_2001.iso / Internet Programs / HTML Webmaster 2.0 / _SETUP.1 / discussionengine.asp < prev    next >
Encoding:
Text File  |  2000-07-21  |  233.2 KB  |  7,541 lines

  1. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  2. //=======================================================================
  3. //
  4. // "ASP Forums" - a web-based discussion forum implementation.
  5. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  6. //
  7. // This library is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU Lesser General Public
  9. // License as published by the Free Software Foundation; either
  10. // version 2.1 of the License, or (at your option) any later version.
  11. //
  12. // This library is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. // Lesser General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU Lesser General Public
  18. // License along with this library; if not, write to the Free Software
  19. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20. //
  21. //=======================================================================
  22.  
  23. //=======================================================================
  24. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  25. //=======================================================================
  26.  
  27. // ======================================================================
  28. // Global variables - yuk!
  29. // ======================================================================
  30. var currentMessage_disc;
  31.  
  32. var currentUsername_disc = "Name Unset";
  33.  
  34. var currentUserFullName_disc = "Unset";
  35.  
  36. var currentUserEmailAddress_disc = "unset@unset.com";
  37.  
  38. var isAdministrator_disc = false;
  39.  
  40. var config = new ASPFConfig ("");
  41.  
  42. var undefined_disc;
  43.  
  44. // ======================================================================
  45. //
  46. // The TRIVIAL interface.
  47. //
  48. // These functions are the simple objects users add to their HTML docs.
  49. // They're a bit simplistic, but their trivially easy to use.
  50. //
  51. // None of them take parameters, and they directly output the object -
  52. // they don't return a string.
  53. //
  54. // ======================================================================
  55.  
  56. function FORUM_LINK_DISC ()
  57. {
  58.     ASPFPageElement.showForumLink ();
  59.     return;
  60. }
  61.  
  62. function PARENT_MESSAGE_LINK_DISC ()
  63. {
  64.     ASPFPageElement.showParentMessageLink ();
  65.     return;
  66. }
  67.  
  68. function SEARCH_FORM_DISC ()
  69. {
  70.     ASPFPageElement.showSearchForm ();
  71.     return;
  72. }
  73.  
  74. function SMALL_SEARCH_FORM_DISC ()
  75. {
  76.     ASPFPageElement.showSmallSearchForm ();
  77.     return;
  78. }
  79.  
  80. function NEW_POST_BUTTON_DISC ()
  81. {
  82.     ASPFPageElement.showNewPostButton ();
  83.     return;
  84. }
  85.  
  86. function NEW_POST_LINK_DISC ()
  87. {
  88.     ASPFPageElement.showNewPostLink ();
  89.     return;
  90. }
  91.  
  92. function NEW_REPLY_BUTTON_DISC ()
  93. {
  94.     ASPFPageElement.showNewReplyButton ();
  95.     return;
  96. }
  97.  
  98. function EDIT_POST_BUTTON_DISC ()
  99. {
  100.     ASPFPageElement.showEditPostButton ();
  101.     return;
  102. }
  103.  
  104. function ALL_ROOT_POSTS_DISC ()
  105. {
  106.     ASPFPageElement.showAllThreads ();
  107.     return;
  108. }
  109.  
  110. function ALL_ROOT_POSTS_THREADED_DISC ()
  111. {
  112.     ASPFPageElement.showAllThreads ();
  113.     return;
  114. }
  115.  
  116. function CURRENT_POSTS_THREADED_DHTML_DISC ()
  117. {
  118.     ASPFPageElement.showCurrentThreads ();
  119.     return;
  120. }
  121.  
  122. function CURRENT_ROOT_POSTS_THREADED_DISC ()
  123. {
  124.     ASPFPageElement.showCurrentThreads ();
  125.     return;
  126. }
  127.  
  128. function CURRENT_ROOT_POSTS_THREADED_STATIC_DISC ()
  129. {
  130.     ASPFPageElement.showCurrentThreadsStatic ();
  131.     return;
  132. }
  133.  
  134. function NEW_POST_FORM_DISC ()
  135. {
  136.     ASPFPageElement.showNewPostForm ();
  137.     return;
  138. }
  139.  
  140. function EDIT_POST_FORM_DISC ()
  141. {
  142.     ASPFPageElement.showEditPostForm ();
  143.     return;
  144. }
  145.  
  146. function ARCHIVE_DISC ()
  147. {
  148.     ASPFPageElement.showArchive ();
  149.     return;
  150. }
  151.  
  152. function SEARCH_RESULTS_DISC ()
  153. {
  154.     ASPFPageElement.actionSearch ();
  155.     return;
  156. }
  157.  
  158. function POST_MESSAGE_DISC ()
  159. {
  160.     ASPFPageElement.actionSaveNewMessage ();
  161.     return;
  162. }
  163.  
  164. function SAVE_EDITED_MESSAGE_DISC ()
  165. {
  166.     ASPFPageElement.actionSaveUpdatedMessage ();
  167.     return;
  168. }
  169.  
  170. function MESSAGE_DISC ()
  171. {
  172.     ASPFPageElement.showCurrentMessage ();
  173.     return;
  174. }
  175.  
  176. function THREAD_DISC ()
  177. {
  178.     ASPFPageElement.showCurrentThread ();
  179.     return;
  180. }
  181.  
  182. function ADMIN_TOOLS_DISC ()
  183. {
  184.     ASPFPageElement.showAdminSQLForm ();
  185.     ASPFPageElement.actionExecuteAdminSQL ();
  186.     return;
  187. }
  188.  
  189. function STD_MESSAGE_DISC ()
  190. {
  191.     ASPFPageElement.showStandardMessage ();
  192.     return;
  193. }
  194.  
  195. function FORUM_TITLE_DISC ()
  196. {
  197.     ASPFPageElement.showForumTitle ();
  198.     return;
  199. }
  200.  
  201. function SUBJECT_DISC ()
  202. {
  203.     ASPFPageElement.showMessageSubject ();
  204.     return;
  205. }
  206.  
  207. function MESSAGE_BODY_DISC ()
  208. {
  209.     ASPFPageElement.showMessageBody ();
  210.     return;
  211. }
  212.  
  213. function AUTHOR_DISC ()
  214. {
  215.     ASPFPageElement.showMessageAuthorName ();
  216.     return;
  217. }
  218.  
  219. function AUTHOR_EMAIL_DISC ()
  220. {
  221.     ASPFPageElement.showMessageAuthorEmail ();
  222.     return;
  223. }
  224.  
  225. function AUTHOR_FULL_NAME_DISC ()
  226. {
  227.     ASPFPageElement.showMessageAuthorFullname ();
  228.     return;
  229. }
  230.  
  231. function DATE_CREATED_DISC ()
  232. {
  233.     ASPFPageElement.showMessageDateCreated ();
  234.     return;
  235. }
  236.  
  237. function DATE_MODIFIED_DISC ()
  238. {
  239.     ASPFPageElement.showMessageDateModified ();
  240.     return;
  241. }
  242.  
  243. function SORT_CODE_DISC ()
  244. {
  245.     ASPFPageElement.showMessageSortCode ();
  246.     return;
  247. }
  248.  
  249. function NUM_CHILDREN_DISC ()
  250. {
  251.     ASPFPageElement.showMessageNumChildren ();
  252.     return;
  253. }
  254.  
  255. function MESSAGE_ID_DISC ()
  256. {
  257.     ASPFPageElement.showMessageID ();
  258.     return;
  259. }
  260.  
  261. function PARENT_ID_DISC ()
  262. {
  263.     ASPFPageElement.showMessageParentID ();
  264.     return;
  265. }
  266.  
  267. function THREAD_ID_DISC ()
  268. {
  269.     ASPFPageElement.showMessageThreadID ();
  270.     return;
  271. }
  272.  
  273. function CLEANUP_DISC ()
  274. {
  275.     var dbase = new ASPFDatabase ();
  276.     dbase.cleanup ();
  277.  
  278.     if (config.CACHE_PurgeOnPageCleanup)
  279.     {
  280.         var cache = new ASPFCache ();
  281.         cache.purge ();
  282.  
  283.         delete cache;
  284.     }
  285.  
  286.     delete dbase;
  287.     delete config;
  288.     delete currentMessage_disc;
  289.     return;
  290. }
  291.  
  292. //=======================================================================
  293. //
  294. // Some global helper functions.  Some of these should have been built into
  295. // the language if you ask me...
  296. //
  297. //=======================================================================
  298.  
  299. function isUndefined_disc (JSvariable)
  300. {
  301.     var isUndefined;
  302.  
  303.     if ("object" == typeof (JSvariable))
  304.     {
  305.         isUndefined = false;
  306.     }
  307.     else
  308.     {
  309.         isUndefined = (String (JSvariable).valueOf () == "undefined" ? true : false);
  310.     }
  311.  
  312.     return isUndefined;
  313. }
  314.  
  315. function isDefined_disc (JSvariable)
  316. {
  317.     return !isUndefined_disc (JSvariable);
  318. }
  319.  
  320. function safeStringDereference_disc (JSvariable)
  321. {
  322.     return (isUndefined_disc (String (JSvariable)) ? "" : String (JSvariable));
  323. }
  324.  
  325. function safeNumberDereference_disc (JSvariable)
  326. {
  327.     return (isUndefined_disc (JSvariable) ? "0" : JSvariable);
  328. }
  329.  
  330. </SCRIPT>
  331.  
  332. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  333. //=======================================================================
  334. //
  335. // "ASP Forums" - a web-based discussion forum implementation.
  336. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  337. //
  338. // This library is free software; you can redistribute it and/or
  339. // modify it under the terms of the GNU Lesser General Public
  340. // License as published by the Free Software Foundation; either
  341. // version 2.1 of the License, or (at your option) any later version.
  342. //
  343. // This library is distributed in the hope that it will be useful,
  344. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  345. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  346. // Lesser General Public License for more details.
  347. //
  348. // You should have received a copy of the GNU Lesser General Public
  349. // License along with this library; if not, write to the Free Software
  350. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  351. //
  352. //=======================================================================
  353.  
  354. //=======================================================================
  355. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  356. //=======================================================================
  357.  
  358. // ======================================================================
  359. //
  360. // CACHE OBJECT
  361. //
  362. // ======================================================================
  363.  
  364. function ASPFCache ()
  365. {
  366. }
  367.  
  368. // ======================================================================
  369. //
  370. // Interface to private member variables.
  371. //
  372. // ======================================================================
  373.  
  374. // ======================================================================
  375. //
  376. // Main object methods.
  377. //
  378. // ======================================================================
  379.  
  380. function retrieveObjectByKey_cch_disc (key)
  381. {
  382.   var object = undefined_disc;
  383.   if (config.CACHE_Enabled)
  384.     {
  385.       key = this.unmangleKey (key);
  386.  
  387.       var retrievedObject;
  388.       var lastUpdated = Application (key + config.CACHE_TimeStampKey);
  389.       if (isDefined_disc (lastUpdated))
  390.     {
  391.       if (this.cacheObjectAlive (lastUpdated))
  392.         {
  393.           object = Application (key);
  394.         }
  395.     }
  396.     }
  397.  
  398.   return object;
  399. }
  400.  
  401. function storeObjectByKey_cch_disc (key, object)
  402. {
  403.   if (config.CACHE_Enabled)
  404.     {
  405.       key = this.unmangleKey (key);
  406.  
  407.       Application.Lock ();
  408.       Application (key) = object;
  409.       Application (key + config.CACHE_TimeStampKey) = (new Date ()).toLocaleString ();
  410.       Application.Unlock ();
  411.     }
  412.  
  413.   return;
  414. }
  415.  
  416. function removeObjectByKey_cch_disc (key)
  417. {
  418.   //Response.Write ("<H3>Removing by key: " + key + "</H3>");
  419.   if (config.CACHE_Enabled)
  420.     {
  421.       key = this.unmangleKey (key);
  422.  
  423.       this.removeObjectPrivateRoutine (key);
  424.       this.removeObjectPrivateRoutine (key + config.CACHE_TimeStampKey);
  425.     }
  426.  
  427.   return;
  428. }
  429.  
  430. function removeObjectPrivateRoutine_cch_disc (unmangledkey)
  431. {
  432.   Application.Lock ();
  433.   if (isDefined_disc (Application (unmangledkey)))
  434.     {
  435.       if (typeof (Application (unmangledkey)) == "object")
  436.     {
  437.       //Response.Write ("<H4>Removing " + unmangledkey + "</H4>");
  438.       Application (unmangledkey).close ();
  439.     }
  440.       Application (unmangledkey) = undefined_disc;
  441.     }
  442.   Application.Unlock ();
  443.  
  444.   return;
  445. }
  446.  
  447. function removeObjectsByKeyPrefix_cch_disc (keyPrefix)
  448. {
  449.   keyPrefix = this.unmangleKey (keyPrefix);
  450.   //Response.Write ("<H3>Removing by prefix: " + keyPrefix + "</H3>");
  451.   var currentKey;
  452.   for (var counter = 1; counter <= Application.Contents.Count; counter++)
  453.     {
  454.       currentKey = Application.Contents.Key (counter);
  455.       if (keyPrefix.toUpperCase () == (currentKey.substring (0, keyPrefix.length)).toUpperCase ())
  456.     {
  457.       this.removeObjectPrivateRoutine (currentKey);
  458.     }
  459.     }
  460.  
  461.   return;
  462. }
  463.  
  464. function purge_cch_disc ()
  465. {
  466.   Response.Write ("<H2>Purging</H2>");
  467.   this.removeObjectsByKeyPrefix (config.getUniqueCacheKeyPrefix ());
  468.  
  469.   return;
  470. }
  471.  
  472. // ======================================================================
  473. //
  474. // Private object methods.  These should not be called except by this object.
  475. //
  476. // ======================================================================
  477.  
  478. function unmangleKey_cch_disc (key)
  479. {
  480.   return config.getUniqueCacheKeyPrefix () + key;
  481. }
  482.  
  483. function cacheObjectAlive_cch_disc (updateTime)
  484. {
  485.   var areWeAlive;
  486.   var itemCachedAt = new Date (updateTime);
  487.   var currentTimeStamp = new Date ();
  488.   var cacheTimeout = config.ADMINSETTING_CacheTimeoutMinutes * 60 * 1000;
  489.  
  490.   if (((currentTimeStamp - itemCachedAt) < cacheTimeout) || (itemCachedAt.getDate () != currentTimeStamp.getDate ()))
  491.     {
  492.       //Response.Write ("<H2>Cached: " + (currentTimeStamp - itemCachedAt) + " is less than " + cacheTimeout + "</H2>");
  493.       areWeAlive = true;
  494.     }
  495.   else
  496.     {
  497.       //Response.Write ("<H2>Not cached: " + (currentTimeStamp - itemCachedAt) + " is greater than " + cacheTimeout + "</H2>");
  498.       areWeAlive = false;
  499.     }
  500.  
  501.   delete itemCachedAt;
  502.   delete currentTimeStamp;
  503.   return areWeAlive;
  504. }
  505.  
  506. ASPFCache.purge = purge_cch_disc;
  507.  
  508. ASPFCache.prototype.retrieveObjectByKey = retrieveObjectByKey_cch_disc;
  509. ASPFCache.prototype.storeObjectByKey = storeObjectByKey_cch_disc;
  510. ASPFCache.prototype.removeObjectByKey = removeObjectByKey_cch_disc;
  511. ASPFCache.prototype.removeObjectPrivateRoutine = removeObjectPrivateRoutine_cch_disc;
  512. ASPFCache.prototype.removeObjectsByKeyPrefix = removeObjectsByKeyPrefix_cch_disc;
  513. ASPFCache.prototype.purge = purge_cch_disc;
  514. ASPFCache.prototype.unmangleKey = unmangleKey_cch_disc;
  515. ASPFCache.prototype.cacheObjectAlive = cacheObjectAlive_cch_disc;
  516. </SCRIPT>
  517.  
  518. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  519. //=======================================================================
  520. //
  521. // "ASP Forums" - a web-based discussion forum implementation.
  522. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  523. //
  524. // This library is free software; you can redistribute it and/or
  525. // modify it under the terms of the GNU Lesser General Public
  526. // License as published by the Free Software Foundation; either
  527. // version 2.1 of the License, or (at your option) any later version.
  528. //
  529. // This library is distributed in the hope that it will be useful,
  530. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  531. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  532. // Lesser General Public License for more details.
  533. //
  534. // You should have received a copy of the GNU Lesser General Public
  535. // License along with this library; if not, write to the Free Software
  536. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  537. //
  538. //=======================================================================
  539.  
  540. //=======================================================================
  541. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  542. //=======================================================================
  543.  
  544. // ======================================================================
  545. //
  546. // CONFIG OBJECT
  547. //
  548. // ======================================================================
  549.  
  550. function ASPFConfig ()
  551. {
  552.   this.ADMINSETTING_ForumName = "Discussion Forum";
  553.  
  554.   this.ADMINSETTING_DatabaseFilename = "forum.mdb";
  555.   this.ADMINSETTING_DatabaseTable = "[Forum]";
  556.   this.ADMINSETTING_DatabaseDSN = "";
  557.  
  558.   this.ADMINSETTING_DaysMessagesActive = 28;
  559.   this.ADMINSETTING_VirtualPath = undefined_disc;
  560.   this.ADMINSETTING_CacheTimeoutMinutes = 120;
  561.  
  562.   this.ADMINSETTING_EmailAdminName = "";
  563.   this.ADMINSETTING_EmailAdminAddress = "";
  564.   this.ADMINSETTING_EmailAlertFromName = "ASP Forums (unknown forum) auto-alert";
  565.   this.ADMINSETTING_EmailAlertFromAddress = "asp-auto-alert@aspforums.com";
  566.   this.ADMINSETTING_EmailAlertSignature = "--\nThis message was generated by ASP Forums discussion software.\nVisit http://www.aspforums.com/ for further information.";
  567.   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>";
  568.  
  569.   // The following govern the images used for expanding and collapsing threads.
  570.   this.ADMINSETTING_ExpandImagePathname = "plus.gif";
  571.   this.ADMINSETTING_ExpandImageWidth = 11;
  572.   this.ADMINSETTING_ExpandImageHeight = 11;
  573.   this.ADMINSETTING_CollapseImagePathname = "minus.gif";
  574.   this.ADMINSETTING_CollapseImageWidth = 11;
  575.   this.ADMINSETTING_CollapseImageHeight = 11;
  576.   this.ADMINSETTING_NoExpandImagePathname = "blank.gif";
  577.   this.ADMINSETTING_NoExpandImageWidth = 11;
  578.   this.ADMINSETTING_NoExpandImageHeight = 11;
  579.  
  580.   // The following govern the images used for the formatting toolbar on the IE5 text control.
  581.   this.ADMINSETTING_ToolbarBackgroundColour = "#CCCCCC";
  582.   this.ADMINSETTING_ToolbarImagePathname = "toolbar.gif";
  583.   this.ADMINSETTING_ToolbarButtonImagePathname = "button_normal.gif";
  584.   this.ADMINSETTING_ToolbarButtonImageUpPathname = "button_up.gif";
  585.   this.ADMINSETTING_ToolbarButtonImageDownPathname = "button_down.gif";
  586.   this.ADMINSETTING_ToolbarButtonImageWidth = 25;
  587.   this.ADMINSETTING_ToolbarButtonImageHeight = 20;
  588.   this.ADMINSETTING_ToolbarSpacerImagePathname = "toolbar_spacer.gif";
  589.   this.ADMINSETTING_ToolbarSpacerImageWidth = 5;
  590.   this.ADMINSETTING_ToolbarSpacerImageHeight = 20;
  591.   this.ADMINSETTING_ToolbarTotalWidth = 300;
  592.  
  593.   // The following govern the appearance of some page elements.
  594.   this.ADMINSETTING_CSSClass = "ASPForums";
  595.   this.ADMINSETTING_CSSClassViewAuthor = "ASPForumsViewAuthor";
  596.   this.ADMINSETTING_CSSClassViewNoChildren = "ASPForumsViewNoChildren";
  597.   this.ADMINSETTING_CSSClassViewOneChild = "ASPForumsViewOneChild";
  598.   this.ADMINSETTING_CSSClassViewManyChildren = "ASPForumsViewManyChildren";
  599.   this.ADMINSETTING_CSSClassViewDate = "ASPForumsViewDate";
  600.   this.ADMINSETTING_CSSClassViewSubject = "ASPForumsViewSubject";
  601.   this.ADMINSETTING_CSSClassMsgPostedByLabel = "ASPForumsMsgPostedByLabel";
  602.   this.ADMINSETTING_CSSClassMsgPostedBy = "ASPForumsMsgPostedBy";
  603.   this.ADMINSETTING_CSSClassMsgPostedOnLabel = "ASPForumsMsgPostedOnLabel";
  604.   this.ADMINSETTING_CSSClassMsgPostedOn = "ASPForumsMsgPostedOn";
  605.   this.ADMINSETTING_CSSClassMsgBodyLabel = "ASPForumsMsgBodyLabel";
  606.   this.ADMINSETTING_CSSClassMsgBody = "ASPForumsMsgBody";
  607.   this.ADMINSETTING_CSSClassFormBody = "ASPForumsFormBody";
  608.   this.ADMINSETTING_CSSClassFormBodyLabel = "ASPForumsFormBodyLabel";
  609.   this.ADMINSETTING_CSSClassFormSubject = "ASPForumsFormSubject";
  610.   this.ADMINSETTING_CSSClassFormSubjectLabel = "ASPForumsFormSubjectLabel";
  611.   this.ADMINSETTING_CSSClassFormEmailResponses = "ASPForumsFormEmailResponses";
  612.   this.ADMINSETTING_CSSClassFormEmailResponsesLabel = "ASPForumsFormEmailResponsesLabel";
  613.   this.ADMINSETTING_CSSClassFormPostedBy = "ASPForumsFormPostedBy";
  614.   this.ADMINSETTING_CSSClassFormPostedByLabel = "ASPForumsFormPostedByLabel";
  615.   this.ADMINSETTING_CSSClassFormFullName = "ASPForumsFormFullName";
  616.   this.ADMINSETTING_CSSClassFormFullNameLabel = "ASPForumsFormFullNameLabel";
  617.   this.ADMINSETTING_CSSClassFormEmailAddress = "ASPForumsFormEmailAddress";
  618.   this.ADMINSETTING_CSSClassFormEmailAddressLabel = "ASPForumsFormEmailAddressLabel";
  619.   this.ADMINSETTING_CSSClassFormSearch = "ASPForumsFormSearch";
  620.   this.ADMINSETTING_CSSClassFormSearchSmall = "ASPForumsFormSearchSmall";
  621.   this.ADMINSETTING_CSSClassFormDateElement = "ASPForumsFormDateElement";
  622.   this.ADMINSETTING_CSSClassFormMonthElement = "ASPForumsFormMonthElement";
  623.   this.ADMINSETTING_CSSClassFormYearElement = "ASPForumsFormYearElement";
  624.   this.ADMINSETTING_TableBorderSize = 0;
  625.   this.ADMINSETTING_TableFullWidth = 468;
  626.   this.ADMINSETTING_TableTitleColumnWidth = 100;
  627.   this.ADMINSETTING_TableFieldColumnWidth = 368;
  628.   this.ADMINSETTING_TextAreaRows = 10;
  629.   this.ADMINSETTING_TextAreaCols = 50;
  630.   this.ADMINSETTING_PrecisLength = 150;
  631.   this.ADMINSETTING_ViewIndentResponseSpaces = 8;
  632.   this.ADMINSETTING_InputboxMaxLength = 100;
  633.   this.ADMINSETTING_SubjectInputboxSize = 50;
  634.   this.ADMINSETTING_StaticViewExpandFirstNThreads = "";
  635.   this.ADMINSETTING_StaticViewShowAtMostNRecords = 0;
  636.  
  637.   // The following switches turn on or off various ASP Forums features.
  638.   this.ADMINSWITCH_AllowEmailResponses = true;
  639.   this.ADMINSWITCH_AllowUserEditing = true;
  640.   this.ADMINSWITCH_AllowRichFormatting = true;
  641.   this.ADMINSWITCH_AllowRichFormattingImages = false;
  642.   this.ADMINSWITCH_AllowHTMLEmail = true;
  643.   this.ADMINSWITCH_ShowExpandCollapse = true;
  644.   this.ADMINSWITCH_ShowEmailAddresses = true;
  645.   this.ADMINSWITCH_ShowNewPostButtonOnMessage = true;
  646.   this.ADMINSWITCH_ViewPostsAscending = false;
  647.   this.ADMINSWITCH_ExpandAllThreads = false;
  648.  
  649.   // The following text strings are used on the default.asp page.
  650.   this.USERTEXT_VIEW_NoMessages = "There are no messages to display.";
  651.   this.USERTEXT_VIEW_NoRepliesTag = "No replies";
  652.   this.USERTEXT_VIEW_OneReplyTag = " reply";
  653.   this.USERTEXT_VIEW_ManyRepliesTag = " replies";
  654.   this.USERTEXT_VIEW_SeparateSubjectAuthor = " by ";
  655.   this.USERTEXT_VIEW_SeparateAuthorDate = " on ";
  656.   this.USERTEXT_VIEW_PopupExpandLink = "+ Expand this thread";
  657.   this.USERTEXT_VIEW_PopupCollapseLink = "- Collapse this thread";
  658.  
  659.   // The following text strings are used on the showmessage.asp page.
  660.   this.USERTEXT_SHOW_NewPostButton = "Post a new message";
  661.   this.USERTEXT_SHOW_EditPostButton = "Edit this post";
  662.   this.USERTEXT_SHOW_ReplyPostButton = "Post a reply";
  663.   this.USERTEXT_SHOW_PostedByPrompt = "Posted by:";
  664.   this.USERTEXT_SHOW_PostedOnPrompt = "Posted on:";
  665.   this.USERTEXT_SHOW_BodyPrompt = "Message:";
  666.   this.USERTEXT_SHOW_PopupSubjectPrefix = "Open message: ";
  667.   this.USERTEXT_SHOW_PopupEmailPrefix = "Email: ";
  668.  
  669.   // The following text strings are used on the newpost.asp, newpostaction.asp, editpost and editpostaction.asp pages.
  670.   this.USERTEXT_POST_UpdateFailedPrefix = "Saving failed: ";
  671.   this.USERTEXT_POST_UpdateSuccessful = "Your changes have been saved.";
  672.   this.USERTEXT_POST_PostFailedPrefix = "Posting failed: ";
  673.   this.USERTEXT_POST_PostSuccessful = "Your message has been posted.  Please do not refresh this page, since that will repost your message!";
  674.   this.USERTEXT_POST_ForumLinkPrefix = "Go back to ";
  675.   this.USERTEXT_POST_ReplySubjectPrefix = "Re: ";
  676.   this.USERTEXT_POST_PreviousMessageLinkText = "Go back to the previous message.";
  677.   this.USERTEXT_POST_UsernamePrompt = " Username:";
  678.   this.USERTEXT_POST_FullnamePrompt = " Full Name:";
  679.   this.USERTEXT_POST_EmailAddressPrompt = " Email Address:";
  680.   this.USERTEXT_POST_PostedByPrompt = " Posted by:";
  681.   this.USERTEXT_POST_SubjectPrompt = " Subject:";
  682.   this.USERTEXT_POST_BodyPrompt = "Message:";
  683.   this.USERTEXT_POST_EmailResponsesPrompt = "Email me when someone responds to my post";
  684.   this.USERTEXT_POST_SubmitButton = "Post Message";
  685.   this.USERTEXT_POST_SaveChangesButton = "Save";
  686.   this.USERTEXT_POST_NotAuthorisedToEditMessage = "You are not authorised to edit this message.";
  687.   this.USERTEXT_POST_ErrorNoSubject = "A subject is required for each post.";
  688.   this.USERTEXT_POST_ErrorNoBody = "A message is required for each post.";
  689.   this.USERTEXT_POST_ErrorNoUsername = "No username was supplied for posting.";
  690.   this.USERTEXT_POST_ErrorNoName = "No name was supplied for posting.";
  691.   this.USERTEXT_POST_ErrorNoEmail = "No email address was supplied for posting.";
  692.   this.USERTEXT_POST_ErrorInvalidThreadID = "An internal error (invalid thread ID) occurred.";
  693.   this.USERTEXT_POST_ErrorInvalidParentID = "An internal error (invalid parent ID) occurred.";
  694.  
  695.   // The following strings are all used on the archive.asp page.
  696.   this.USERTEXT_ARCHIVE_ShowResults = "Show posts from that month";
  697.  
  698.   // The following strings are used on the search.asp page.
  699.   this.USERTEXT_SEARCH_SmallSearchPrefix = "Keyword search forum:";
  700.   this.USERTEXT_SEARCH_SubmitButton = "Search Forum";
  701.   this.USERTEXT_SEARCH_ResultsHeader1 = "Your search for ";
  702.   this.USERTEXT_SEARCH_ResultsHeader2 = " found ";
  703.   this.USERTEXT_SEARCH_ResultsHeaderSuffix0Match = " matches.";
  704.   this.USERTEXT_SEARCH_ResultsHeaderSuffix1Match = " match.";
  705.   this.USERTEXT_SEARCH_ResultsHeaderSuffixManyMatches = " matches.";
  706.  
  707.   // The following strings are used on the admin.asp page.
  708.   this.USERTEXT_SQL_EnterPrompt = "Enter your SQL queries or updates below:"
  709.   this.USERTEXT_SQL_ExecutePrompt = "Execute SQL";
  710.   this.USERTEXT_SQL_ResultsPrefix = "Results:";
  711.   this.USERTEXT_SQL_StatementPrefix = "SQL statement: ";
  712.   this.USERTEXT_SQL_DBErrorPrefix = "Database errors occured:";
  713.   this.USERTEXT_SQL_DBErrorNumberPrompt = "Error Number = ";
  714.   this.USERTEXT_SQL_DBErrorDescriptionPrompt = "Error description = ";
  715.   this.USERTEXT_SQL_DBErrorNoErrorPrompt = "No database errors occured.";
  716.   this.USERTEXT_SQL_DeleteSuccessfulMessage = "Deletion successful";
  717.   this.USERTEXT_SQL_DeleteUnsuccessfulMessage = "Deletion failed";
  718.   this.USERTEXT_SQL_DeleteHierarchyButton = "Delete Subthread From Message ID";
  719.   this.USERTEXT_SQL_PurgeCacheButton = "Purge Cache";
  720.  
  721.   // The following strings are all used in email messages.
  722.   this.USERTEXT_MAIL_AdminNewPostSubjectPrefix = "New Post";
  723.   this.USERTEXT_MAIL_AdminNewPostBodyPrefix = "A new message by ";
  724.   this.USERTEXT_MAIL_AdminNewPostSeparateNameForum = " was posted in ";
  725.   this.USERTEXT_MAIL_UserNewPostSeparateNameForum = " has responded to your post in ";
  726.   this.USERTEXT_MAIL_UserNewPostSeparateNameMessage = " has responded to your message: ";
  727.   this.USERTEXT_MAIL_UserNewPostNameSuffix = " has responded to your message. ";
  728.   this.USERTEXT_MAIL_UserNewPostMessagePrefix = "The response reads: ";
  729.  
  730.   // The following are used by our general string-handling routines.
  731.   this.USERTEXT_STRING_StringTruncatedSuffix = "...";
  732.   this.USERTEXT_STRING_WarningUnverifiedEmail = "WARNING: Email link created by poster. ";
  733.   this.USERTEXT_STRING_WarningUnverifiedImage = "WARNING: Image embedded by poster. ";
  734.   this.USERTEXT_STRING_WarningUnverifiedLink = "WARNING: URL created by poster. ";
  735.  
  736.   // You can rename the files involved, should you really want to.
  737.   this.PAGE_AdminLocalPath = "admin.asp";
  738.   this.PAGE_ArchiveLocalPath = "archive.asp";
  739.   this.PAGE_EditPostActionLocalPath = "editpostaction.asp";
  740.   this.PAGE_EditPostLocalPath = "editpost.asp";
  741.   this.PAGE_MainLocalPath = "default.asp";
  742.   this.PAGE_MainPreferredLocalPath = "./";
  743.   this.PAGE_NewPostActionLocalPath = "newpostaction.asp";
  744.   this.PAGE_NewPostLocalPath = "newpost.asp";
  745.   this.PAGE_SearchLocalPath = "search.asp";
  746.   this.PAGE_ShowMessageLocalPath = "showmessage.asp";
  747.  
  748.   this.CACHE_TimeStampKey = "Timestamp";
  749.   this.CACHE_Enabled = false;
  750.   this.CACHE_PurgeOnPageCleanup = false;
  751.   this.CACHE_ItemSeparator = "|";
  752.   this.CACHE_AllRootMessagesKey = "AllRoot";
  753.   this.CACHE_CurrentRootMessagesKeyPrefix = "CurrentRoot";
  754.   this.CACHE_AllCurrentMessagesKeyPrefix = "AllCurrent";
  755.   this.CACHE_RootArchivedMessagesKeyPrefix = "ArchivedRoot";
  756.   this.CACHE_AllArchivedMessagesKeyPrefix = "ArchivedAll";
  757.   this.CACHE_AllThreadMessagesKey = "AllThread";
  758.   this.CACHE_SubThreadMessagesKey = "SubThread";
  759.  
  760.   this.CONST_NoError = 0;
  761.   this.CONST_Error = 1;
  762.  
  763.   this.FORM_MessageFormName = "ASPFMessage";
  764.   this.FORM_SearchFormName = "ASPFSearch";
  765.   this.FORM_ArchiveFormName = "ASPFArchive";
  766.   this.FORM_AdminDeleteFormName = "ASPFAdminDelete";
  767.   this.FORM_AdminPurgeFormName = "ASPFAdminPurge";
  768.   this.FORM_AdminSQLFormName = "ASPFAdminSQL";
  769.   this.FORM_CheckboxChecked = " CHECKED";
  770.   this.FORM_CheckboxUnchecked = "";
  771.   this.FORM_CheckboxTrue = "Yes";
  772.  
  773.   this.FORM_QueryStringMessageID = "messageID";
  774.   this.FORM_QueryStringViewExpand = "expand";
  775.   this.FORM_QueryStringViewCollapse = "collapse";
  776.   this.FORM_QueryStringViewCentre = "centreOnMessage-";
  777.  
  778.   this.FORM_FieldMessageID = "messageID";
  779.   this.FORM_FieldSubject = "subject";
  780.   this.FORM_FieldMessage = "message";
  781.   this.FORM_FieldSortCode = "sortCode";
  782.   this.FORM_FieldParentID = "parentID";
  783.   this.FORM_FieldThreadID = "threadID";
  784.   this.FORM_FieldEmailResponses = "emailResponses";
  785.   this.FORM_FieldHiddenEmailOnResponse = "emailParentOnResponse";
  786.   this.FORM_FieldSearchString = "SearchString";
  787.   this.FORM_FieldUsername = "username";
  788.   this.FORM_FieldEmailaddress = "emailaddress";
  789.   this.FORM_FieldFullname = "fullname";
  790.   this.FORM_FieldSQLStatement = "SQLStatement";
  791.   this.FORM_FieldMessageIDToDelete = "messageIDToDelete";
  792.   this.FORM_FieldPurgeCache = "purgeCache";
  793.   this.FORM_FieldArchiveDate = "archiveDate";
  794.   this.FORM_FieldDateDaySuffix = "Day";
  795.   this.FORM_FieldDateMonthSuffix = "Month";
  796.   this.FORM_FieldDateYearSuffix = "Year";
  797.  
  798.   this.DATABASE_MaxSortcodeSize = 25;
  799.   this.DATABASE_MaxSubjectSize = 100;
  800.   this.DATABASE_MaxMessageSize = 2500;
  801.   this.DATABASE_MaxUsernameSize = 50;
  802.   this.DATABASE_MaxFullnameSize = 50;
  803.   this.DATABASE_MaxEmailAddressSize = 50;
  804.   this.DATABASE_FieldMessageID = "messageID";
  805.   this.DATABASE_FieldParentID = "parent";
  806.   this.DATABASE_FieldThreadID = "threadID";
  807.   this.DATABASE_FieldSortCode = "sortCode";
  808.   this.DATABASE_FieldNumChildren = "numChildren";
  809.   this.DATABASE_FieldAuthorName = "author";
  810.   this.DATABASE_FieldAuthorFullName = "authorFullName";
  811.   this.DATABASE_FieldAuthorEmail = "authorEmail";
  812.   this.DATABASE_FieldSubject = "subject";
  813.   this.DATABASE_FieldBody = "body";
  814.   this.DATABASE_FieldEmailParentOnResponse = "emailParentOnResponse";
  815.   this.DATABASE_FieldDateCreated = "dateCreated";
  816.   this.DATABASE_FieldDateModified = "dateModified";
  817.  
  818.   this.SYS_DHTMLEventHandler = "expandCollapseForumClick_disc (event); return false;";
  819.   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";
  820.   this.SYS_CurrentVersion = "2.0 beta 1";
  821.   this.SYS_CurrentVersionReference = "ASP Forums " + this.SYS_CurrentVersion;
  822.  
  823.   return this;
  824. }
  825.  
  826. function getAdminPagePath_cnf_disc ()
  827. {
  828.   var pagePath;
  829.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  830.     {
  831.       pagePath = this.PAGE_AdminLocalPath;
  832.     }
  833.   else
  834.     {
  835.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_AdminLocalPath;
  836.     }
  837.  
  838.   return pagePath;
  839. }
  840.  
  841. function getArchivePagePath_cnf_disc ()
  842. {
  843.   var pagePath;
  844.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  845.     {
  846.       pagePath = this.PAGE_ArchiveLocalPath;
  847.     }
  848.   else
  849.     {
  850.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_ArchiveLocalPath;
  851.     }
  852.  
  853.   return pagePath;
  854. }
  855.  
  856. function getMainPagePath_cnf_disc ()
  857. {
  858.   var pagePath;
  859.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  860.     {
  861.       pagePath = this.PAGE_MainLocalPath;
  862.     }
  863.   else
  864.     {
  865.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_MainLocalPath;
  866.     }
  867.  
  868.   return pagePath;
  869. }
  870.  
  871. function getMainPagePreferredPath_cnf_disc ()
  872. {
  873.   var pagePath;
  874.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  875.     {
  876.       pagePath = this.PAGE_MainPreferredLocalPath;
  877.     }
  878.   else
  879.     {
  880.       pagePath = this.ADMINSETTING_VirtualPath;
  881.     }
  882.  
  883.   return pagePath;
  884. }
  885.  
  886. function getNewPostActionPagePath_cnf_disc ()
  887. {
  888.   var pagePath;
  889.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  890.     {
  891.       pagePath = this.PAGE_NewPostActionLocalPath;
  892.     }
  893.   else
  894.     {
  895.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_NewPostActionLocalPath;
  896.     }
  897.  
  898.   return pagePath;
  899. }
  900.  
  901. function getNewPostPagePath_cnf_disc ()
  902. {
  903.   var pagePath;
  904.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  905.     {
  906.       pagePath = this.PAGE_NewPostLocalPath;
  907.     }
  908.   else
  909.     {
  910.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_NewPostLocalPath;
  911.     }
  912.  
  913.   return pagePath;
  914. }
  915.  
  916. function getEditPostActionPagePath_cnf_disc ()
  917. {
  918.   var pagePath;
  919.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  920.     {
  921.       pagePath = this.PAGE_EditPostActionLocalPath;
  922.     }
  923.   else
  924.     {
  925.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_EditPostActionLocalPath;
  926.     }
  927.  
  928.   return pagePath;
  929. }
  930.  
  931. function getEditPostPagePath_cnf_disc ()
  932. {
  933.   var pagePath;
  934.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  935.     {
  936.       pagePath = this.PAGE_EditPostLocalPath;
  937.     }
  938.   else
  939.     {
  940.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_EditPostLocalPath;
  941.     }
  942.  
  943.   return pagePath;
  944. }
  945.  
  946. function getSearchPagePath_cnf_disc ()
  947. {
  948.   var pagePath;
  949.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  950.     {
  951.       pagePath = this.PAGE_SearchLocalPath;
  952.     }
  953.   else
  954.     {
  955.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_SearchLocalPath;
  956.     }
  957.  
  958.   return pagePath;
  959. }
  960.  
  961. function getShowMessagePagePath_cnf_disc ()
  962. {
  963.   var pagePath;
  964.   if (isUndefined_disc (this.ADMINSETTING_VirtualPath))
  965.     {
  966.       pagePath = this.PAGE_ShowMessageLocalPath;
  967.     }
  968.   else
  969.     {
  970.       pagePath = this.ADMINSETTING_VirtualPath + this.PAGE_ShowMessageLocalPath;
  971.     }
  972.  
  973.   return pagePath;
  974. }
  975.  
  976. function getDatabaseDSN_cnf_disc ()
  977. {
  978.   if (this.ADMINSETTING_DatabaseDSN == "")
  979.     {
  980.       var DBPath = Server.MapPath (this.ADMINSETTING_DatabaseFilename);
  981.  
  982.       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
  983.     }
  984.  
  985.   return this.ADMINSETTING_DatabaseDSN;
  986. }
  987.  
  988. function getSiteBaseURL_cnf_disc ()
  989. {
  990.   return "http://" + String (Request.ServerVariables ("HTTP_HOST"));
  991. }
  992.  
  993. function getEditableUserInfoSwitch_cnf_disc ()
  994. {
  995.   var infoEditable;
  996.   if ((currentUsername_disc == "") || (currentUserFullName_disc == "") || (currentUserEmailAddress_disc == ""))
  997.     {
  998.       infoEditable = true;
  999.     }
  1000.   else
  1001.     {
  1002.       infoEditable = false;
  1003.     }
  1004.  
  1005.   return infoEditable;
  1006. }
  1007.  
  1008. function getUserHTMLMailPreference_cnf_disc (usernameToCheck)
  1009. {
  1010.   return true;
  1011. }
  1012.  
  1013. function getUserEmailResponsePreference_cnf_disc (usernameToCheck)
  1014. {
  1015.   return false;
  1016. }
  1017.  
  1018. function getUniqueCacheKeyPrefix_cnf_disc ()
  1019. {
  1020.   return this.ADMINSETTING_ForumName + this.ADMINSETTING_DatabaseTable;
  1021. }
  1022.  
  1023. function switchToForum_cnf_disc (newForumName, newForumTableName, newForumDSN, newForumFilename, newForumVirtualPath)
  1024. {
  1025.   this.ADMINSETTING_ForumName = "Discussion Forum";
  1026.  
  1027.   this.ADMINSETTING_DatabaseFilename = "forum.mdb";
  1028.   this.ADMINSETTING_DatabaseTable = "[Forum]";
  1029.   this.ADMINSETTING_DatabaseDSN = "";
  1030.  
  1031.   this.ADMINSETTING_DaysMessagesActive = 28;
  1032.   this.ADMINSETTING_VirtualPath = undefined_disc;
  1033.   this.ADMINSETTING_CacheTimeoutMinutes = 120;
  1034.   if (isDefined_disc (newForumName))
  1035.     {
  1036.       this.ADMINSETTING_ForumName = newForumName;
  1037.     }
  1038.  
  1039.   if (isDefined_disc (newForumTableName))
  1040.     {
  1041.       this.ADMINSETTING_DatabaseTable = newForumTableName;
  1042.     }
  1043.  
  1044.   if (isDefined_disc (newForumDSN))
  1045.     {
  1046.       this.ADMINSETTING_DatabaseDSN = newForumDSN;
  1047.     }
  1048.  
  1049.   if (isDefined_disc (newForumFilename))
  1050.     {
  1051.       this.ADMINSETTING_DatabaseFilename = newForumFilename;
  1052.     }
  1053.  
  1054.   if (isDefined_disc (newForumVirtualPath))
  1055.     {
  1056.       this.ADMINSETTING_VirtualPath = newForumVirtualPath;
  1057.     }
  1058.  
  1059.   return;
  1060. }
  1061.  
  1062. ASPFConfig.prototype.getAdminPagePath = getAdminPagePath_cnf_disc;
  1063. ASPFConfig.prototype.getArchivePagePath = getArchivePagePath_cnf_disc;
  1064. ASPFConfig.prototype.getEditPostActionPagePath = getEditPostActionPagePath_cnf_disc;
  1065. ASPFConfig.prototype.getEditPostPagePath = getEditPostPagePath_cnf_disc;
  1066. ASPFConfig.prototype.getMainPagePath = getMainPagePath_cnf_disc;
  1067. ASPFConfig.prototype.getMainPagePreferredPath = getMainPagePreferredPath_cnf_disc;
  1068. ASPFConfig.prototype.getNewPostActionPagePath = getNewPostActionPagePath_cnf_disc;
  1069. ASPFConfig.prototype.getNewPostPagePath = getNewPostPagePath_cnf_disc;
  1070. ASPFConfig.prototype.getSearchPagePath = getSearchPagePath_cnf_disc;
  1071. ASPFConfig.prototype.getShowMessagePagePath = getShowMessagePagePath_cnf_disc;
  1072.  
  1073. ASPFConfig.prototype.getEditableUserInfoSwitch = getEditableUserInfoSwitch_cnf_disc;
  1074. ASPFConfig.prototype.getDatabaseDSN = getDatabaseDSN_cnf_disc;
  1075. ASPFConfig.prototype.getSiteBaseURL = getSiteBaseURL_cnf_disc;
  1076. ASPFConfig.prototype.getUserHTMLMailPreference = getUserHTMLMailPreference_cnf_disc;
  1077. ASPFConfig.prototype.getUserEmailResponsePreference = getUserEmailResponsePreference_cnf_disc;
  1078. ASPFConfig.prototype.getUniqueCacheKeyPrefix = getUniqueCacheKeyPrefix_cnf_disc;
  1079. ASPFConfig.prototype.switchToForum = switchToForum_cnf_disc;
  1080. </SCRIPT>
  1081.  
  1082. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  1083. //=======================================================================
  1084. //
  1085. // "ASP Forums" - a web-based discussion forum implementation.
  1086. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  1087. //
  1088. // This library is free software; you can redistribute it and/or
  1089. // modify it under the terms of the GNU Lesser General Public
  1090. // License as published by the Free Software Foundation; either
  1091. // version 2.1 of the License, or (at your option) any later version.
  1092. //
  1093. // This library is distributed in the hope that it will be useful,
  1094. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1095. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1096. // Lesser General Public License for more details.
  1097. //
  1098. // You should have received a copy of the GNU Lesser General Public
  1099. // License along with this library; if not, write to the Free Software
  1100. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  1101. //
  1102. //=======================================================================
  1103.  
  1104. //=======================================================================
  1105. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  1106. //=======================================================================
  1107.  
  1108. // ======================================================================
  1109. //
  1110. // DATABASE OBJECT
  1111. //
  1112. // ======================================================================
  1113.  
  1114. function ASPFDatabase ()
  1115. {
  1116.   return this;
  1117. }
  1118.  
  1119. // ======================================================================
  1120. //
  1121. // Interface to recordset fields (not private member variables).
  1122. //
  1123. // ======================================================================
  1124.  
  1125. function getSubjectField_db_disc (messageRecord)
  1126. {
  1127.   return String (messageRecord.fields (config.DATABASE_FieldSubject));
  1128. }
  1129.  
  1130. function getBodyField_db_disc (messageRecord)
  1131. {
  1132.   return String (messageRecord.fields (config.DATABASE_FieldBody));
  1133. }
  1134.  
  1135. function getSortCodeField_db_disc (messageRecord)
  1136. {
  1137.   return String (messageRecord.fields (config.DATABASE_FieldSortCode));
  1138. }
  1139.  
  1140. function getAuthorNameField_db_disc (messageRecord)
  1141. {
  1142.   return String (messageRecord.fields (config.DATABASE_FieldAuthorName));
  1143. }
  1144.  
  1145. function getAuthorEmailField_db_disc (messageRecord)
  1146. {
  1147.   return String (messageRecord.fields (config.DATABASE_FieldAuthorEmail));
  1148. }
  1149.  
  1150. function getAuthorFullnameField_db_disc (messageRecord)
  1151. {
  1152.   return String (messageRecord.fields (config.DATABASE_FieldAuthorFullName));
  1153. }
  1154.  
  1155. function getAuthorEmailField_db_disc (messageRecord)
  1156. {
  1157.   return String (messageRecord.fields (config.DATABASE_FieldAuthorEmail));
  1158. }
  1159.  
  1160. function getMessageIDField_db_disc (messageRecord)
  1161. {
  1162.   return messageRecord.fields (config.DATABASE_FieldMessageID);
  1163. }
  1164.  
  1165. function getParentIDField_db_disc (messageRecord)
  1166. {
  1167.   return messageRecord.fields (config.DATABASE_FieldParentID);
  1168. }
  1169.  
  1170. function getThreadIDField_db_disc (messageRecord)
  1171. {
  1172.   return messageRecord.fields (config.DATABASE_FieldThreadID);
  1173. }
  1174.  
  1175. function getNumChildrenField_db_disc (messageRecord)
  1176. {
  1177.   return messageRecord.fields (config.DATABASE_FieldNumChildren);
  1178. }
  1179.  
  1180. function getDateCreatedField_db_disc (messageRecord)
  1181. {
  1182.   return String (messageRecord.fields (config.DATABASE_FieldDateCreated));
  1183. }
  1184.  
  1185. function getDateModifiedField_db_disc (messageRecord)
  1186. {
  1187.   return String (messageRecord.fields (config.DATABASE_FieldDateModified));
  1188. }
  1189.  
  1190. function getEmailParentOnResponseField_db_disc (messageRecord)
  1191. {
  1192.   return messageRecord.fields (config.DATABASE_FieldEmailParentOnResponse);
  1193. }
  1194.  
  1195. // ======================================================================
  1196. //
  1197. // Main object methods.
  1198. //
  1199. // ======================================================================
  1200.  
  1201. function getAllRootMessages_db_disc (sortAscending)
  1202. {
  1203.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldParentID + " = 0 ORDER BY " + config.DATABASE_FieldDateCreated;
  1204.   if (sortAscending)
  1205.     {
  1206.       SQLString = SQLString + " ASC";
  1207.     }
  1208.   else
  1209.     {
  1210.       SQLString = SQLString + " DESC";
  1211.     }
  1212.  
  1213.   return this.getCachedOrNewData (config.CACHE_AllRootMessagesKey, SQLString);
  1214. }
  1215.  
  1216. function getCurrentRootMessages_db_disc (sortAscending)
  1217. {
  1218.   var cutoffDate = new Date ();
  1219.   cutoffDate.setDate (cutoffDate.getDate () - config.ADMINSETTING_DaysMessagesActive);
  1220.  
  1221.   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;
  1222.   if (sortAscending)
  1223.     {
  1224.       SQLString += " ASC";
  1225.     }
  1226.   else
  1227.     {
  1228.       SQLString += " DESC";
  1229.     }
  1230.  
  1231.   delete cutoffDate;
  1232.   return this.getCachedOrNewData (config.CACHE_CurrentRootMessagesKeyPrefix + config.CACHE_ItemSeparator + config.ADMINSETTING_DaysMessagesActive, SQLString);
  1233. }
  1234.  
  1235. function getAllCurrentMessages_db_disc (sortAscending)
  1236. {
  1237.   var cutoffDate = new Date ();
  1238.   cutoffDate.setDate (cutoffDate.getDate () - config.ADMINSETTING_DaysMessagesActive);
  1239.  
  1240.   var sortOrder;
  1241.   if (sortAscending)
  1242.     {
  1243.       sortOrder = " ASC";
  1244.     }
  1245.   else
  1246.     {
  1247.       sortOrder = " DESC";
  1248.     }
  1249.  
  1250.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " > {d '" + cutoffDate.getODBCNormalisedDate () + "'} ORDER BY " + config.DATABASE_FieldThreadID + sortOrder + ", " + config.DATABASE_FieldSortCode + " ASC";
  1251.  
  1252.   delete cutoffDate;
  1253.   return this.getCachedOrNewData (config.CACHE_AllCurrentMessagesKeyPrefix + config.CACHE_ItemSeparator + config.ADMINSETTING_DaysMessagesActive, SQLString);
  1254. }
  1255.  
  1256. function getArchiveRootMessages_db_disc (archiveDate, sortAscending)
  1257. {
  1258.   var cutoffDate = new Date (archiveDate);
  1259.   cutoffDate.setMonth (archiveDate.getMonth () + 1);
  1260.  
  1261.   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;
  1262.   if (sortAscending)
  1263.     {
  1264.       SQLString += " ASC";
  1265.     }
  1266.   else
  1267.     {
  1268.       SQLString += " DESC";
  1269.     }
  1270.  
  1271.   delete cutoffDate;
  1272.   return this.getCachedOrNewData (config.CACHE_RootArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + config.ADMINSETTING_DaysMessagesActive, SQLString);
  1273. }
  1274.  
  1275. function getAllArchiveMessages_db_disc (archiveDate, sortAscending)
  1276. {
  1277.   var cutoffDate = new Date (archiveDate);
  1278.   cutoffDate.setMonth (archiveDate.getMonth () + 1);
  1279.  
  1280.   var sortOrder;
  1281.   if (sortAscending)
  1282.     {
  1283.       sortOrder = " ASC";
  1284.     }
  1285.   else
  1286.     {
  1287.       sortOrder = " DESC";
  1288.     }
  1289.  
  1290.   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";
  1291.  
  1292.   delete cutoffDate;
  1293.   return this.getCachedOrNewData (config.CACHE_AllArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + archiveDate.getYear () + config.CACHE_ItemSeparator + archiveDate.getMonth (), SQLString);
  1294. }
  1295.  
  1296. function getAllThreadMessages_db_disc (threadID)
  1297. {
  1298.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldThreadID + " = " + threadID + " ORDER BY "  + config.DATABASE_FieldSortCode;
  1299.  
  1300.   return this.getCachedOrNewData (config.CACHE_AllThreadMessagesKey + config.CACHE_ItemSeparator + threadID, SQLString);
  1301. }
  1302.  
  1303. function getSubThreadMessages_db_disc (threadID, startAtSortCode)
  1304. {
  1305.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldThreadID + " = " + threadID + " AND " + config.DATABASE_FieldSortCode + " >= '" + startAtSortCode + "' ORDER BY " + config.DATABASE_FieldSortCode;
  1306.  
  1307.   return this.getCachedOrNewData (config.CACHE_SubThreadMessagesKey + config.CACHE_ItemSeparator + threadID + config.CACHE_ItemSeparator + startAtSortCode, SQLString);
  1308. }
  1309.  
  1310. function getMessageByID_db_disc (messageID)
  1311. {
  1312.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldMessageID + " = " + messageID;
  1313.  
  1314.   return new ASPFMessage (this.executeSQL (SQLString));
  1315. }
  1316.  
  1317. function getRecordByID_db_disc (messageID)
  1318. {
  1319.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldMessageID + " = " + messageID;
  1320.  
  1321.   return this.executeSQL (SQLString);
  1322. }
  1323.  
  1324. function getRecordBySortCode_db_disc (sortCode)
  1325. {
  1326.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldSortCode + " = " + sortCode;
  1327.  
  1328.   return new ASPFMessage (this.executeSQL (SQLString));
  1329. }
  1330.  
  1331. function getRecordByDateCreated_db_disc (dateCreated)
  1332. {
  1333.   var SQLString = "SELECT * FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldDateCreated + " = {d '" + dateCreated.getODBCNormalisedDate () + "'}";
  1334.  
  1335.   return new ASPFMessage (this.executeSQL (SQLString));
  1336. }
  1337.  
  1338. function getOpenDatabaseConnection_db_disc ()
  1339. {
  1340.   var connection;
  1341.  
  1342.   if (isDefined_disc (ASPFDatabase.DBConnection))
  1343.     {
  1344.       connection = ASPFDatabase.DBConnection;
  1345.     }
  1346.   else
  1347.     {
  1348.       connection = Server.CreateObject ("ADODB.Connection");
  1349.       connection.Mode = adModeReadWrite;
  1350.  
  1351.       connection.Open (config.getDatabaseDSN ());
  1352.       ASPFDatabase.DBConnection = connection;
  1353.     }
  1354.  
  1355.   return connection;
  1356. }
  1357.  
  1358. function getAdminSQLResults_db_disc (connection, SQLString)
  1359. {
  1360.   return this.executeSQLUsingConnection (SQLString, connection);
  1361. }
  1362.  
  1363. function executeSQL_db_disc (SQLString)
  1364. {
  1365.   var connection = this.getOpenDatabaseConnection ();
  1366.  
  1367.   return this.executeSQLUsingConnection (SQLString, connection);
  1368. }
  1369.  
  1370. function executeSQLUsingConnection_db_disc (SQLString, connection)
  1371. {
  1372.   var recordSet;
  1373.   var command;
  1374.  
  1375.   command = Server.CreateObject ("ADODB.Command");
  1376.   command.CommandText = SQLString;
  1377.   command.CommandType = adCmdText;
  1378.  
  1379.   recordSet = Server.CreateObject ("ADODB.RecordSet");
  1380.  
  1381.   //Response.Write ("<H5>" + SQLString + "</H5>");
  1382.   //Response.Write ("<pre>" + executeSQLUsingConnection_db_disc.caller + "</pre>");
  1383.  
  1384.   recordSet.Open (SQLString, connection, adOpenKeyset, adLockOptimistic, adCmdText);
  1385.  
  1386.   delete command;
  1387.   return recordSet;
  1388. }
  1389.  
  1390. function searchForum_db_disc (stringToSearchFor)
  1391. {
  1392.   var searchString;
  1393.   searchString = String (stringToSearchFor).replace (/\'/gi, ASPFHTML.DOUBLE_QUOTES ());
  1394.  
  1395.   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";
  1396.  
  1397.   return this.executeSQL (SQLString);
  1398. }
  1399.  
  1400. function saveNewRecord_db_disc (message)
  1401. {
  1402.   var postedDate = new Date();
  1403.  
  1404.   var connection = this.getOpenDatabaseConnection ();
  1405.   this.beginTransaction ();
  1406.  
  1407.   message.setSortCode (this.getNewSortCode (message.parentID));
  1408.   message.setDateCreated (postedDate);
  1409.   message.setDateModified (postedDate);
  1410.  
  1411.   var newMessageRecord = Server.CreateObject ("ADODB.RecordSet");
  1412.  
  1413.   newMessageRecord.Open (config.ADMINSETTING_DatabaseTable, connection, adOpenKeyset, adLockPessimistic, adCmdTable);
  1414.   newMessageRecord.AddNew ();
  1415.  
  1416.   newMessageRecord.Fields (config.DATABASE_FieldDateCreated) = postedDate.getODBCNormalisedTimeStamp ();
  1417.   newMessageRecord.Fields (config.DATABASE_FieldDateModified) = postedDate.getODBCNormalisedTimeStamp ();
  1418.   newMessageRecord.Fields (config.DATABASE_FieldParentID) = message.getParentID ();
  1419.   newMessageRecord.Fields (config.DATABASE_FieldNumChildren) = 0;
  1420.   newMessageRecord.Fields (config.DATABASE_FieldSortCode) = message.getSortCode ();
  1421.   newMessageRecord.Fields (config.DATABASE_FieldThreadID) = message.getThreadID ();
  1422.   newMessageRecord.Fields (config.DATABASE_FieldAuthorName) = message.getAuthorName ();
  1423.   newMessageRecord.Fields (config.DATABASE_FieldAuthorFullName) = message.getAuthorFullname ();
  1424.   newMessageRecord.Fields (config.DATABASE_FieldAuthorEmail) = message.getAuthorEmail ();
  1425.   newMessageRecord.Fields (config.DATABASE_FieldEmailParentOnResponse) = ((message.getEmailParentOnResponse () == true) ? "True" : "False");
  1426.   newMessageRecord.Fields (config.DATABASE_FieldSubject) = message.getSubject ();
  1427.   newMessageRecord.Fields (config.DATABASE_FieldBody) = message.getBody ();
  1428.  
  1429.   newMessageRecord.Update ();
  1430.   var newMessage = new ASPFMessage (newMessageRecord);
  1431.  
  1432.   message.setMessageID (newMessage.getMessageID ());
  1433.   if (isUndefined_disc (message.getThreadID ()) || (message.getThreadID () == 0))
  1434.     {
  1435.       message.setThreadID (newMessage.getMessageID ());
  1436.     }
  1437.  
  1438.   if (newMessage.getSortCode () == "0")
  1439.     {
  1440.       var SQLString = "UPDATE " + config.ADMINSETTING_DatabaseTable + " SET " + config.DATABASE_FieldThreadID + " = " + newMessage.getMessageID () + ", " + config.DATABASE_FieldSortCode + " = str(" + newMessage.getMessageID () + ") WHERE " + config.DATABASE_FieldMessageID + " = " + newMessage.getMessageID ();
  1441.       this.executeSQLUsingConnection (SQLString, connection);
  1442.     }
  1443.  
  1444.   if (connection.Errors.Count == 0)
  1445.     {
  1446.       this.commitTransaction ();
  1447.     }
  1448.   else
  1449.     {
  1450.       this.rollbackTransaction ();
  1451.     }
  1452.  
  1453.   this.expireCurrentCache ();
  1454.   this.expireThreadCache (newMessage.getThreadID ());
  1455.   this.expireArchiveCache (postedDate);
  1456.  
  1457.   connection = "";
  1458.   newMessageRecord.Close ();
  1459.  
  1460.   delete postedDate;
  1461.   delete newMessageRecord;
  1462.   delete newMessage;
  1463.   return newMessage.getMessageID ();
  1464. }
  1465.  
  1466. function saveUpdatedRecord_db_disc (message)
  1467. {
  1468.   var modifiedDate = new Date();
  1469.   message.setDateModified (modifiedDate);
  1470.  
  1471.   var connection = this.getOpenDatabaseConnection ();
  1472.   this.beginTransaction ();
  1473.  
  1474.   var messageRecord = this.getRecordByID (message.getMessageID ());
  1475.  
  1476.   var newNumChildren;
  1477.   void message.getNumChildren ();
  1478.  
  1479.   void messageRecord.Fields (config.DATABASE_FieldNumChildren);
  1480.   if (message.getNumChildren () > messageRecord.Fields (config.DATABASE_FieldNumChildren))
  1481.     {
  1482.       newNumChildren = message.getNumChildren ();
  1483.     }
  1484.   else
  1485.     {
  1486.       newNumChildren = messageRecord.Fields (config.DATABASE_FieldNumChildren);
  1487.     }
  1488.  
  1489.   messageRecord.Fields (config.DATABASE_FieldDateModified) = modifiedDate.getODBCNormalisedTimeStamp ();
  1490.   messageRecord.Fields (config.DATABASE_FieldNumChildren) = newNumChildren;
  1491.   messageRecord.Fields (config.DATABASE_FieldAuthorName) = message.getAuthorName ();
  1492.   messageRecord.Fields (config.DATABASE_FieldAuthorFullName) = message.getAuthorFullname ();
  1493.   messageRecord.Fields (config.DATABASE_FieldAuthorEmail) = message.getAuthorEmail ();
  1494.   messageRecord.Fields (config.DATABASE_FieldEmailParentOnResponse) = ((message.getEmailParentOnResponse () == true) ? "True" : "False");
  1495.   messageRecord.Fields (config.DATABASE_FieldSubject) = message.getSubject ();
  1496.   messageRecord.Fields (config.DATABASE_FieldBody) = message.getBody ();
  1497.  
  1498.   if (message.getEmailParentOnResponse () == true)
  1499.     {
  1500.     }
  1501.   messageRecord.Update ();
  1502.  
  1503.   if (connection.Errors.Count == 0)
  1504.     {
  1505.       this.commitTransaction ();
  1506.     }
  1507.   else
  1508.     {
  1509.       this.rollbackTransaction ();
  1510.     }
  1511.  
  1512.   this.expireCurrentCache ();
  1513.   this.expireThreadCache (message.getThreadID ());
  1514.   this.expireArchiveCache (modifiedDate);
  1515.  
  1516.   connection = "";
  1517.   messageRecord.Close ();
  1518.  
  1519.   delete messageRecord;
  1520.   delete modifiedDate;
  1521.   return;
  1522. }
  1523.  
  1524. function getNewSortCode_db_disc (parentID)
  1525. {
  1526.   var newSortCode;
  1527.  
  1528.   if (parentID == 0)
  1529.     {
  1530.       newSortCode = "0";
  1531.     }
  1532.   else
  1533.     {
  1534.       var parentMessage = this.getMessageByID (parentID);
  1535.  
  1536.       parentMessage.setNumChildren (parentMessage.getNumChildren () + 1);
  1537.  
  1538.       newSortCode = parentMessage.getSortCode () + "." + parentMessage.getNumChildren ();
  1539.  
  1540.       parentMessage.saveUpdatedData ();
  1541.  
  1542.       delete parentMessage;
  1543.     }
  1544.  
  1545.   return newSortCode;
  1546. }
  1547.  
  1548. function deleteMessage_db_disc (connection, messageID)
  1549. {
  1550.   var messageToDelete = this.getMessageByID (messageID);
  1551.   var parentID = messageToDelete.getParentID ();
  1552.   if (messageToDelete.getNumChildren () > 0)
  1553.     {
  1554.       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;
  1555.       var children =     this.executeSQLUsingConnection (threadSQLString, connection);
  1556.       while (!children.EOF)
  1557.     {
  1558.       children.Delete();
  1559.       children.MoveNext();
  1560.     }
  1561.       delete children;
  1562.     }
  1563.  
  1564.   var SQLString = "DELETE FROM " + config.ADMINSETTING_DatabaseTable + " WHERE " + config.DATABASE_FieldMessageID + " = " + messageID;
  1565.   this.executeSQLUsingConnection (SQLString, connection);
  1566.  
  1567.   delete messageToDelete;
  1568.   return;
  1569. }
  1570.  
  1571. function decrementNumChildren_db_disc (connection, parentID)
  1572. {
  1573.   if (parentID != 0)
  1574.     {
  1575.       var parentMessage = this.getMessageByID (parentID);
  1576.  
  1577.       var SQLString = "UPDATE " + config.ADMINSETTING_DatabaseTable + " SET " + config.DATABASE_FieldNumChildren + "=" + (parentMessage.getNumChildren () - 1) + " WHERE " + config.DATABASE_FieldMessageID + " = " + parentID;
  1578.       this.executeSQLUsingConnection (SQLString, connection);
  1579.       delete parentMessage;
  1580.     }
  1581.  
  1582.   return;
  1583. }
  1584.  
  1585. function getConnectionErrors_db_disc (connection)
  1586. {
  1587.   var errorOutput = "";
  1588.  
  1589.   if (connection.errors.count > 0)
  1590.     {
  1591.       errorOutput += config.USERTEXT_SQL_DBErrorPrefix;
  1592.  
  1593.       var counter;
  1594.       for (counter = 0; counter < connection.errors.count; counter++)
  1595.     {
  1596.       errorOutput += config.USERTEXT_SQL_DBErrorNumberPrompt;
  1597.       errorOutput += connection.errors(counter).number + "\n";
  1598.  
  1599.       errorOutput += config.USERTEXT_SQL_DBErrorDescriptionPrompt;
  1600.       errorOutput += connection.errors(counter).description + "\n";
  1601.     }
  1602.     }
  1603.   else
  1604.     {
  1605.       errorOutput += config.USERTEXT_SQL_DBErrorNoErrorPrompt;
  1606.     }
  1607.  
  1608.   return errorOutput;
  1609. }
  1610.  
  1611. function deleteMessageHierarchy_db_disc (messageID)
  1612. {
  1613.   var connection = this.getOpenDatabaseConnection ();
  1614.   this.beginTransaction ();
  1615.  
  1616.   var messageToDelete = this.getMessageByID (messageID);
  1617.   var parentID = messageToDelete.getParentID ();
  1618.   var returnedMessage = "";
  1619.  
  1620.   this.deleteMessage (connection, messageID);
  1621.  
  1622.   this.decrementNumChildren (connection, parentID);
  1623.  
  1624.   if (connection.Errors.Count == 0)
  1625.     {
  1626.       returnedMessage = config.USERTEXT_SQL_DeleteSuccessfulMessage.strong ();
  1627.       this.commitTransaction ();
  1628.     }
  1629.   else
  1630.     {
  1631.       returnedMessage = config.USERTEXT_SQL_DeleteUnsuccessfulMessage.strong ();
  1632.       this.rollbackTransaction ();
  1633.     }
  1634.  
  1635.   delete messageToDelete;
  1636.   return returnedMessage;
  1637. }
  1638.  
  1639. function beginTransaction_db_disc ()
  1640. {
  1641.   if (ASPFDatabase.DBTransactionLevel == 0)
  1642.     {
  1643.       var connection = this.getOpenDatabaseConnection ();
  1644.       connection.BeginTrans ();
  1645.       connection = "";
  1646.     }
  1647.  
  1648.   ASPFDatabase.DBTransactionLevel++;
  1649.   return;
  1650. }
  1651.  
  1652. function commitTransaction_db_disc ()
  1653. {
  1654.   if (ASPFDatabase.DBTransactionLevel == 1)
  1655.     {
  1656.       var connection = this.getOpenDatabaseConnection ();
  1657.       connection.CommitTrans ();
  1658.       connection = "";
  1659.     }
  1660.  
  1661.   ASPFDatabase.DBTransactionLevel--;
  1662.   return;
  1663. }
  1664.  
  1665. function rollbackTransaction_db_disc ()
  1666. {
  1667.   var connection = this.getOpenDatabaseConnection ();
  1668.   connection.RollbackTrans ();
  1669.   connection = "";
  1670.   ASPFDatabase.DBTransactionLevel = 0;
  1671.  
  1672.   return;
  1673. }
  1674.  
  1675. function isInTransation_db_disc ()
  1676. {
  1677.   var isInTransaction;
  1678.   if (ASPFDatabase.DBTransactionLevel > 0)
  1679.     {
  1680.       isInTransaction = true;
  1681.     }
  1682.   else
  1683.     {
  1684.       isInTransaction = false;
  1685.     }
  1686.  
  1687.   return isInTransation;
  1688. }
  1689.  
  1690. function getCachedOrNewData_db_disc (itemKey, SQLString)
  1691. {
  1692.   var newData;
  1693.   var cache = new ASPFCache ();
  1694.   var cachedData = cache.retrieveObjectByKey (itemKey);
  1695.  
  1696.   if (isUndefined_disc (cachedData))
  1697.     {
  1698.       //Response.Write ("<H2>Retrieving new information</H2>");
  1699.       newData = this.executeSQL (SQLString);
  1700.       cache.storeObjectByKey (itemKey, newData);
  1701.     }
  1702.   else
  1703.     {
  1704.       //Response.Write ("<H2>Using cached information</H2>");
  1705.       newData = cachedData;
  1706.       if (newData.RecordCount > 0)
  1707.     {
  1708.       newData.MoveFirst ();
  1709.     }
  1710.     }
  1711.  
  1712.   delete cache;
  1713.   return newData;
  1714. }
  1715.  
  1716. function expireThreadCache_db_disc (threadID)
  1717. {
  1718.   //Response.Write ("<H2>Expiring thread cache for " + threadID + "</H2>");
  1719.   var cache = new ASPFCache ();
  1720.   cache.removeObjectByKey (config.CACHE_AllThreadMessagesKey + config.CACHE_ItemSeparator + threadID);
  1721.   cache.removeObjectsByKeyPrefix (config.CACHE_SubThreadMessagesKey + config.CACHE_ItemSeparator + threadID);
  1722.  
  1723.   delete cache;
  1724.   return;
  1725. }
  1726.  
  1727. function expireCurrentCache_db_disc ()
  1728. {
  1729.   //Response.Write ("<H2>Expiring current cache</H2>");
  1730.   var cache = new ASPFCache ();
  1731.   cache.removeObjectByKey (config.CACHE_AllRootMessagesKey);
  1732.   cache.removeObjectsByKeyPrefix (config.CACHE_AllCurrentMessagesKeyPrefix);
  1733.   cache.removeObjectsByKeyPrefix (config.CACHE_CurrentRootMessagesKeyPrefix);
  1734.  
  1735.   delete cache;
  1736.   return;
  1737. }
  1738.  
  1739. function expireArchiveCache_db_disc (archiveDate)
  1740. {
  1741.   if (isDefined_disc (archiveDate))
  1742.     {
  1743.       var cache = new ASPFCache ();
  1744.       cache.removeObjectByKey (config.CACHE_AllArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + archiveDate.getYear () + config.CACHE_ItemSeparator + archiveDate.getMonth ());
  1745.       cache.removeObjectByKey (config.CACHE_RootArchivedMessagesKeyPrefix + config.CACHE_ItemSeparator + archiveDate.getYear () + config.CACHE_ItemSeparator + archiveDate.getMonth ());
  1746.       delete cache;
  1747.     }
  1748.  
  1749.   return;
  1750. }
  1751.  
  1752. function cleanup_db_disc ()
  1753. {
  1754.   if (isDefined_disc (ASPFDatabase.DBConnection))
  1755.     {
  1756.       delete ASPFDatabase.DBConnection;
  1757.     }
  1758.  
  1759.   return;
  1760. }
  1761.  
  1762. ASPFDatabase.DBConnection = undefined_disc;
  1763. ASPFDatabase.DBTransactionLevel = 0;
  1764.  
  1765. ASPFDatabase.prototype.getSubjectField = getSubjectField_db_disc;
  1766. ASPFDatabase.prototype.getBodyField = getBodyField_db_disc;
  1767. ASPFDatabase.prototype.getSortCodeField = getSortCodeField_db_disc;
  1768. ASPFDatabase.prototype.getAuthorNameField = getAuthorNameField_db_disc;
  1769. ASPFDatabase.prototype.getAuthorEmailField = getAuthorEmailField_db_disc;
  1770. ASPFDatabase.prototype.getAuthorFullnameField = getAuthorFullnameField_db_disc;
  1771. ASPFDatabase.prototype.getAuthorEmailField = getAuthorEmailField_db_disc;
  1772. ASPFDatabase.prototype.getMessageIDField = getMessageIDField_db_disc;
  1773. ASPFDatabase.prototype.getParentIDField = getParentIDField_db_disc;
  1774. ASPFDatabase.prototype.getThreadIDField = getThreadIDField_db_disc;
  1775. ASPFDatabase.prototype.getNumChildrenField = getNumChildrenField_db_disc;
  1776. ASPFDatabase.prototype.getDateCreatedField = getDateCreatedField_db_disc;
  1777. ASPFDatabase.prototype.getDateModifiedField = getDateModifiedField_db_disc;
  1778. ASPFDatabase.prototype.getEmailParentOnResponseField = getEmailParentOnResponseField_db_disc;
  1779.  
  1780. ASPFDatabase.prototype.getAllRootMessages = getAllRootMessages_db_disc;
  1781. ASPFDatabase.prototype.getCurrentRootMessages = getCurrentRootMessages_db_disc;
  1782. ASPFDatabase.prototype.getAllCurrentMessages = getAllCurrentMessages_db_disc;
  1783. ASPFDatabase.prototype.getArchiveRootMessages = getArchiveRootMessages_db_disc;
  1784. ASPFDatabase.prototype.getAllArchiveMessages = getAllArchiveMessages_db_disc;
  1785. ASPFDatabase.prototype.getAllThreadMessages = getAllThreadMessages_db_disc;
  1786. ASPFDatabase.prototype.getSubThreadMessages = getSubThreadMessages_db_disc;
  1787. ASPFDatabase.prototype.getMessageByID = getMessageByID_db_disc;
  1788. ASPFDatabase.prototype.getRecordByID = getRecordByID_db_disc;
  1789. ASPFDatabase.prototype.getRecordBySortCode = getRecordBySortCode_db_disc;
  1790. ASPFDatabase.prototype.getRecordByDateCreated = getRecordByDateCreated_db_disc;
  1791. ASPFDatabase.prototype.getOpenDatabaseConnection = getOpenDatabaseConnection_db_disc;
  1792. ASPFDatabase.prototype.getAdminSQLResults = getAdminSQLResults_db_disc;
  1793. ASPFDatabase.prototype.executeSQL = executeSQL_db_disc;
  1794. ASPFDatabase.prototype.executeSQLUsingConnection = executeSQLUsingConnection_db_disc;
  1795. ASPFDatabase.prototype.getNewSortCode = getNewSortCode_db_disc;
  1796. ASPFDatabase.prototype.deleteMessage = deleteMessage_db_disc;
  1797. ASPFDatabase.prototype.decrementNumChildren = decrementNumChildren_db_disc;
  1798. ASPFDatabase.prototype.getConnectionErrors = getConnectionErrors_db_disc;
  1799. ASPFDatabase.prototype.deleteMessageHierarchy = deleteMessageHierarchy_db_disc;
  1800. ASPFDatabase.prototype.searchForum = searchForum_db_disc;
  1801. ASPFDatabase.prototype.saveNewRecord = saveNewRecord_db_disc;
  1802. ASPFDatabase.prototype.saveUpdatedRecord = saveUpdatedRecord_db_disc;
  1803. ASPFDatabase.prototype.beginTransaction = beginTransaction_db_disc;
  1804. ASPFDatabase.prototype.commitTransaction = commitTransaction_db_disc;
  1805. ASPFDatabase.prototype.rollbackTransaction = rollbackTransaction_db_disc;
  1806. ASPFDatabase.prototype.isInTransation = isInTransation_db_disc;
  1807. ASPFDatabase.prototype.getCachedOrNewData = getCachedOrNewData_db_disc;
  1808. ASPFDatabase.prototype.expireThreadCache = expireThreadCache_db_disc;
  1809. ASPFDatabase.prototype.expireCurrentCache = expireCurrentCache_db_disc;
  1810. ASPFDatabase.prototype.expireArchiveCache = expireArchiveCache_db_disc;
  1811. ASPFDatabase.prototype.cleanup = cleanup_db_disc;
  1812. </SCRIPT>
  1813.  
  1814. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  1815. //=======================================================================
  1816. //
  1817. // "ASP Forums" - a web-based discussion forum implementation.
  1818. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  1819. //
  1820. // This library is free software; you can redistribute it and/or
  1821. // modify it under the terms of the GNU Lesser General Public
  1822. // License as published by the Free Software Foundation; either
  1823. // version 2.1 of the License, or (at your option) any later version.
  1824. //
  1825. // This library is distributed in the hope that it will be useful,
  1826. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1827. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1828. // Lesser General Public License for more details.
  1829. //
  1830. // You should have received a copy of the GNU Lesser General Public
  1831. // License along with this library; if not, write to the Free Software
  1832. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  1833. //
  1834. //=======================================================================
  1835.  
  1836. //=======================================================================
  1837. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  1838. //=======================================================================
  1839.  
  1840. // ======================================================================
  1841. //
  1842. // DATE OBJECT ADDITIONS
  1843. //
  1844. // ======================================================================
  1845.  
  1846. function getODBCNormalisedDate_date_disc ()
  1847. {
  1848.   var yearString;
  1849.   var monthString;
  1850.   var dayString;
  1851.  
  1852.   yearString = this.getFullYear ();
  1853.  
  1854.   monthString = this.getMonth () + 1;
  1855.   if (monthString < 10)
  1856.     {
  1857.       monthString = "0" + monthString;
  1858.     }
  1859.  
  1860.   dayString = this.getDate ();
  1861.   if (dayString < 10)
  1862.     {
  1863.       dayString = "0" + dayString;
  1864.     }
  1865.  
  1866.   return yearString + "-" + monthString + "-" + dayString;
  1867. }
  1868.  
  1869. function getODBCNormalisedTime_date_disc ()
  1870. {
  1871.   var normalisedTime = "";
  1872.  
  1873.   if (this.getHours () >= 10)
  1874.     {
  1875.       normalisedTime += this.getHours ();
  1876.     }
  1877.   else
  1878.     {
  1879.       normalisedTime += "0" + this.getHours ();
  1880.     }
  1881.  
  1882.   normalisedTime += ":";
  1883.  
  1884.   if (this.getMinutes () >= 10)
  1885.     {
  1886.       normalisedTime += this.getMinutes ();
  1887.     }
  1888.   else
  1889.     {
  1890.       normalisedTime += "0" + this.getMinutes ();
  1891.     }
  1892.  
  1893.   normalisedTime += ":";
  1894.  
  1895.   if (this.getSeconds () >= 10)
  1896.     {
  1897.       normalisedTime += this.getSeconds ();
  1898.     }
  1899.   else
  1900.     {
  1901.       normalisedTime += "0" + this.getSeconds ();
  1902.     }
  1903.  
  1904.   return normalisedTime;
  1905. }
  1906.  
  1907. function getODBCNormalisedTimeStamp_date_disc ()
  1908. {
  1909.   return this.getODBCNormalisedDate () + " " + this.getODBCNormalisedTime ();
  1910. }
  1911.  
  1912. function getMonthName_date_disc (index)
  1913. {
  1914.   return this.getMonthNameByIndex (this.getMonth ());
  1915. }
  1916.  
  1917. function getDayName_date_disc (index)
  1918. {
  1919.   return this.getDayNameByIndex (this.getDay ());
  1920. }
  1921.  
  1922. function getDateSuffix_date_disc (index)
  1923. {
  1924.   return this.getDateSuffixByIndex (this.getDate ());
  1925. }
  1926.  
  1927. function getMonthNameByIndex_date_disc (index)
  1928. {
  1929.   var monthName;
  1930.   switch (index)
  1931.     {
  1932.     case 0:
  1933.       monthName = "January";
  1934.       break;
  1935.  
  1936.     case 1:
  1937.       monthName = "February";
  1938.       break;
  1939.  
  1940.     case 2:
  1941.       monthName = "March";
  1942.       break;
  1943.  
  1944.     case 3:
  1945.       monthName = "April";
  1946.       break;
  1947.  
  1948.     case 4:
  1949.       monthName = "May";
  1950.       break;
  1951.  
  1952.     case 5:
  1953.       monthName = "June";
  1954.       break;
  1955.  
  1956.     case 6:
  1957.       monthName = "July";
  1958.       break;
  1959.  
  1960.     case 7:
  1961.       monthName = "August";
  1962.       break;
  1963.  
  1964.     case 8:
  1965.       monthName = "September";
  1966.       break;
  1967.  
  1968.     case 9:
  1969.       monthName = "October";
  1970.       break;
  1971.  
  1972.     case 10:
  1973.       monthName = "November";
  1974.       break;
  1975.  
  1976.     case 11:
  1977.       monthName = "December";
  1978.       break;
  1979.  
  1980.     default:
  1981.       monthName = "Error";
  1982.       break;
  1983.     }
  1984.  
  1985.   return monthName;
  1986. }
  1987.  
  1988. function getDayNameByIndex_date_disc (index)
  1989. {
  1990.   var dayName;
  1991.   switch (index)
  1992.     {
  1993.     case 0:
  1994.       dayName = "Sunday";
  1995.       break;
  1996.  
  1997.     case 1:
  1998.       dayName = "Monday";
  1999.       break;
  2000.  
  2001.     case 2:
  2002.       dayName = "Tuesday";
  2003.       break;
  2004.  
  2005.     case 3:
  2006.       dayName = "Wednesday";
  2007.       break;
  2008.  
  2009.     case 4:
  2010.       dayName = "Thursday";
  2011.       break;
  2012.  
  2013.     case 5:
  2014.       dayName = "Friday";
  2015.       break;
  2016.  
  2017.     case 6:
  2018.       dayName = "Saturday";
  2019.       break;
  2020.  
  2021.     default:
  2022.       dayName = "Error";
  2023.       break;
  2024.     }
  2025.  
  2026.   return dayName;
  2027. }
  2028.  
  2029. function getDateSuffixByIndex_date_disc (index)
  2030. {
  2031.   var dateSuffix;
  2032.  
  2033.   switch (index)
  2034.     {
  2035.     case 1:
  2036.     case 21:
  2037.     case 31:
  2038.       dateSuffix = "st";
  2039.       break;
  2040.  
  2041.     case 2:
  2042.     case 22:
  2043.       dateSuffix = "nd";
  2044.       break;
  2045.  
  2046.     case 3:
  2047.     case 23:
  2048.       dateSuffix = "rd";
  2049.       break;
  2050.  
  2051.     case 4:
  2052.     case 5:
  2053.     case 6:
  2054.     case 7:
  2055.     case 8:
  2056.     case 9:
  2057.     case 10:
  2058.     case 11:
  2059.     case 12:
  2060.     case 13:
  2061.     case 14:
  2062.     case 15:
  2063.     case 16:
  2064.     case 17:
  2065.     case 18:
  2066.     case 19:
  2067.     case 20:
  2068.     case 21:
  2069.     case 22:
  2070.     case 23:
  2071.     case 24:
  2072.     case 25:
  2073.     case 26:
  2074.     case 27:
  2075.     case 28:
  2076.     case 29:
  2077.     case 30:
  2078.       dateSuffix = "th";
  2079.       break;
  2080.  
  2081.     case 0:
  2082.     default:
  2083.       dateSuffix = "Error";
  2084.       break;
  2085.     }
  2086.  
  2087.   return dateSuffix;
  2088. }
  2089.  
  2090. function getShortFormat_date_disc ()
  2091. {
  2092.   var HTMLout = this.getDayName () + ", " + this.getDate() + this.getDateSuffix() + " " + this.getMonthName () + " " + this.getFullYear();
  2093.  
  2094.   delete dateValue;
  2095.   return HTMLout;
  2096. }
  2097.  
  2098. function getLongFormat_date_disc ()
  2099. {
  2100.   var HTMLout = this.getDayName () + ", " + this.getDate () + this.getDateSuffix () + " " + this.getMonthName () + " " + this.getFullYear();
  2101.  
  2102.   return HTMLout;
  2103. }
  2104.  
  2105. Date.getMonthNameByIndex = getMonthNameByIndex_date_disc;
  2106. Date.getDayNameByIndex = getDayNameByIndex_date_disc;
  2107. Date.getDateSuffixByIndex = getDateSuffixByIndex_date_disc;
  2108.  
  2109. Date.prototype.getODBCNormalisedDate = getODBCNormalisedDate_date_disc;
  2110. Date.prototype.getODBCNormalisedTime = getODBCNormalisedTime_date_disc;
  2111. Date.prototype.getODBCNormalisedTimeStamp = getODBCNormalisedTimeStamp_date_disc;
  2112. Date.prototype.getMonthName = getMonthName_date_disc;
  2113. Date.prototype.getDayName = getDayName_date_disc;
  2114. Date.prototype.getDateSuffix = getDateSuffix_date_disc;
  2115. Date.prototype.getMonthNameByIndex = getMonthNameByIndex_date_disc;
  2116. Date.prototype.getDayNameByIndex = getDayNameByIndex_date_disc;
  2117. Date.prototype.getDateSuffixByIndex = getDateSuffixByIndex_date_disc;
  2118. Date.prototype.getShortFormat = getShortFormat_date_disc;
  2119. Date.prototype.getLongFormat = getLongFormat_date_disc;
  2120. </SCRIPT>
  2121.  
  2122. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  2123. //=======================================================================
  2124. //
  2125. // "ASP Forums" - a web-based discussion forum implementation.
  2126. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  2127. //
  2128. // This library is free software; you can redistribute it and/or
  2129. // modify it under the terms of the GNU Lesser General Public
  2130. // License as published by the Free Software Foundation; either
  2131. // version 2.1 of the License, or (at your option) any later version.
  2132. //
  2133. // This library is distributed in the hope that it will be useful,
  2134. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  2135. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2136. // Lesser General Public License for more details.
  2137. //
  2138. // You should have received a copy of the GNU Lesser General Public
  2139. // License along with this library; if not, write to the Free Software
  2140. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  2141. //
  2142. //=======================================================================
  2143.  
  2144. //=======================================================================
  2145. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  2146. //=======================================================================
  2147.  
  2148. // ======================================================================
  2149. //
  2150. // EMAIL OBJECT
  2151. //
  2152. // ======================================================================
  2153.  
  2154. function ASPFEmail ()
  2155. {
  2156.   this.toName = "";
  2157.   this.toAddress = "";
  2158.   this.fromName = "";
  2159.   this.fromAddress = "";
  2160.   this.subject = "";
  2161.   this.body = "";
  2162.  
  2163.   return this;
  2164. }
  2165.  
  2166. // ======================================================================
  2167. //
  2168. // Interface to private member variables.
  2169. //
  2170. // ======================================================================
  2171.  
  2172. function getToName_eml_disc ()
  2173. {
  2174.   return this.toName;
  2175. }
  2176.  
  2177. function setToName_eml_disc (newToName)
  2178. {
  2179.   this.toName = newToName;
  2180.   return;
  2181. }
  2182.  
  2183. function getToAddress_eml_disc ()
  2184. {
  2185.   return this.toAddress;
  2186. }
  2187.  
  2188. function setToAddress_eml_disc (newToAddress)
  2189. {
  2190.   this.toAddress = newToAddress;
  2191.   return;
  2192. }
  2193.  
  2194. function getFromName_eml_disc ()
  2195. {
  2196.   return this.fromName;
  2197. }
  2198.  
  2199. function setFromName_eml_disc (newFromName)
  2200. {
  2201.   this.fromName = newFromName;
  2202.   return;
  2203. }
  2204.  
  2205. function getFromAddress_eml_disc ()
  2206. {
  2207.   return this.fromAddress;
  2208. }
  2209.  
  2210. function setFromAddress_eml_disc (newFromAddress)
  2211. {
  2212.   this.fromAddress = newFromAddress;
  2213.   return;
  2214. }
  2215.  
  2216. function getSubject_eml_disc ()
  2217. {
  2218.   return this.subject;
  2219. }
  2220.  
  2221. function setSubject_eml_disc (newSubject)
  2222. {
  2223.   this.subject = newSubject;
  2224.   return;
  2225. }
  2226.  
  2227. function getBody_eml_disc ()
  2228. {
  2229.   return this.body;
  2230. }
  2231.  
  2232. function setBody_eml_disc (newBody)
  2233. {
  2234.   this.toBody = newBody;
  2235.   return;
  2236. }
  2237.  
  2238. // ======================================================================
  2239. //
  2240. // Main object methods.
  2241. //
  2242. // ======================================================================
  2243.  
  2244. function getFromEmailLink_eml_disc ()
  2245. {
  2246.   var HTMLout;
  2247.  
  2248.   if (config.ADMINSWITCH_ShowEmailAddresses)
  2249.     {
  2250.       HTMLout = A_open_html_disc ("mailto:" + this.fromAddress, config.USERTEXT_SHOW_PopupEmailPrefix + this.fromName + " (" + this.fromAddress + ")");
  2251.       HTMLout += this.fromName;
  2252.       HTMLout += ASPFHTML.A_close ();
  2253.     }
  2254.   else
  2255.     {
  2256.       HTMLout = this.fromName;
  2257.     }
  2258.  
  2259.   return HTMLout;
  2260. }
  2261.  
  2262. function getHTMLMessageBody_eml_disc (message, title, bodyText, signature)
  2263. {
  2264.   var messageBody = "";
  2265.   messageBody += ASPFHTML.DTD ();
  2266.   messageBody += ASPFHTML.HTML_open ();
  2267.  
  2268.   messageBody += ASPFHTML.BODY_open ("#FFFFFF", undefined_disc, "#0000FF", "#FF0000", "#660066");
  2269.  
  2270.   messageBody += ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, undefined_disc, undefined_disc, undefined_disc, 0, 0);
  2271.  
  2272.   messageBody += ASPFHTML.TR_open ();
  2273.   messageBody += ASPFHTML.TD_open (140, undefined_disc, "#99CCFF");
  2274.   messageBody += ASPFHTML.DIV_open (undefined_disc, undefined_disc, "center");
  2275.   messageBody += ASPFHTML.A_open ("http://www.aspforums.com/");
  2276.   messageBody += ASPFHTML.IMG ("http://www.aspforums.com/images/logo.gif", "ASP Forums", 0, 120, 56);
  2277.   messageBody += ASPFHTML.A_close ();
  2278.   messageBody += ASPFHTML.DIV_close ();
  2279.   messageBody += ASPFHTML.TD_close ();
  2280.   messageBody += ASPFHTML.TD_open (468, undefined_disc, "#336699");
  2281.   messageBody += ASPFHTML.FONT_open (5, "Tahoma", "#FFFFFF");
  2282.   messageBody += ASPFHTML.NBSP ();
  2283.   messageBody += title;
  2284.   messageBody += ASPFHTML.FONT_close ();
  2285.   messageBody += ASPFHTML.TD_close ();
  2286.   messageBody += ASPFHTML.TR_close ();
  2287.  
  2288.   messageBody += ASPFHTML.TR_open ();
  2289.   messageBody += ASPFHTML.TD_open (140);
  2290.   messageBody += ASPFHTML.NBSP ();
  2291.   messageBody += ASPFHTML.TD_close ();
  2292.   messageBody += ASPFHTML.TD_open (config.ADMINSETTING_TableFullWidth);
  2293.  
  2294.   messageBody += ASPFHTML.P_open ();
  2295.   messageBody += ASPFHTML.NBSP ();
  2296.   messageBody += ASPFHTML.P_close ();
  2297.  
  2298.   messageBody += ASPFHTML.FONT_open (-1, "Tahoma");
  2299.  
  2300.   messageBody += bodyText;
  2301.  
  2302.   messageBody += ASPFHTML.FONT_close ();
  2303.   messageBody += ASPFHTML.TD_close ();
  2304.   messageBody += ASPFHTML.TR_close ();
  2305.  
  2306.   messageBody += ASPFHTML.TR_open ();
  2307.   messageBody += ASPFHTML.TD_open (140);
  2308.   messageBody += ASPFHTML.NBSP ();
  2309.   messageBody += ASPFHTML.TD_close ();
  2310.   messageBody += ASPFHTML.TD_open (config.ADMINSETTING_TableFullWidth);
  2311.  
  2312.   messageBody += signature;
  2313.  
  2314.   messageBody += ASPFHTML.P_open ();
  2315.   messageBody += ASPFHTML.NBSP ();
  2316.   messageBody += ASPFHTML.P_close ();
  2317.   messageBody += ASPFHTML.FONT_close ();
  2318.   messageBody += ASPFHTML.TD_close ();
  2319.   messageBody += ASPFHTML.TR_close ();
  2320.   messageBody += ASPFHTML.TABLE_close ();
  2321.  
  2322.   return messageBody;
  2323. }
  2324.  
  2325. function sendHTML_eml_disc ()
  2326. {
  2327.   var From = this.fromName + " <" + this.fromAddress + ">";
  2328.   var To = this.toAddress;
  2329.  
  2330.   sendHTMLMailMessage_eml_disc (To, From, this.subject, this.body, config.getSiteBaseURL ());
  2331. }
  2332.  
  2333. function send_eml_disc ()
  2334. {
  2335.   var From = this.fromName + " <" + this.fromAddress + ">";
  2336.   var To = this.toAddress;
  2337.  
  2338.   sendRegularMailMessage_eml_disc (To, From, this.subject, this.body);
  2339. }
  2340.  
  2341. ASPFEmail.prototype.getFromEmailLink = getFromEmailLink_eml_disc;
  2342. ASPFEmail.prototype.getHTMLMessageBody = getHTMLMessageBody_eml_disc;
  2343. ASPFEmail.prototype.sendHTML = sendHTML_eml_disc;
  2344. ASPFEmail.prototype.send = send_eml_disc;
  2345. </SCRIPT>
  2346.  
  2347. <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
  2348. ' Has to be in VBScript for the error recovery.
  2349. Sub sendRegularMailMessage_eml_disc (messageTo, messageFrom, messageSubject, messageBody)
  2350.   On Error Resume Next
  2351.  
  2352.   Dim mailMessage
  2353.   Set mailMessage = Server.CreateObject ("CDONTS.NewMail")
  2354.  
  2355.   if Not mailMessage is Nothing then
  2356.     mailMessage.From = messageFrom
  2357.     mailMessage.To = messageTo
  2358.     mailMessage.Subject = messageSubject
  2359.     mailMessage.Body = messageBody
  2360.  
  2361.     mailMessage.Send
  2362.     Set mailMessage = Nothing
  2363.   end if
  2364. End Sub
  2365.  
  2366. Sub sendHTMLMailMessage_eml_disc (messageTo, messageFrom, messageSubject, messageBody, baseURL)
  2367.   On Error Resume Next
  2368.  
  2369.   Dim mailMessage
  2370.   Set mailMessage = Server.CreateObject ("CDONTS.NewMail")
  2371.  
  2372.   if Not mailMessage is Nothing then
  2373.     mailMessage.From = messageFrom
  2374.     mailMessage.To = messageTo
  2375.     mailMessage.Subject = messageSubject
  2376.     mailMessage.Body = messageBody
  2377.  
  2378.     mailMessage.ContentBase = baseURL
  2379.     mailMessage.BodyFormat = 0
  2380.     mailMessage.MailFormat = 0 
  2381.  
  2382.     mailMessage.Send
  2383.     Set mailMessage = Nothing
  2384.   end if
  2385. End Sub
  2386. </SCRIPT>
  2387.  
  2388. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  2389. //=======================================================================
  2390. //
  2391. // "ASP Forums" - a web-based discussion forum implementation.
  2392. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  2393. //
  2394. // This library is free software; you can redistribute it and/or
  2395. // modify it under the terms of the GNU Lesser General Public
  2396. // License as published by the Free Software Foundation; either
  2397. // version 2.1 of the License, or (at your option) any later version.
  2398. //
  2399. // This library is distributed in the hope that it will be useful,
  2400. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  2401. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2402. // Lesser General Public License for more details.
  2403. //
  2404. // You should have received a copy of the GNU Lesser General Public
  2405. // License along with this library; if not, write to the Free Software
  2406. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  2407. //
  2408. //=======================================================================
  2409.  
  2410. //=======================================================================
  2411. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  2412. //=======================================================================
  2413.  
  2414. // ======================================================================
  2415. //
  2416. // EXPANDCOLLAPSE OBJECT
  2417. //
  2418. // ======================================================================
  2419.  
  2420. function ASPFExpandCollapse (message, viewIndex, currentThreadID, activeThreadID, pageURLToUse)
  2421. {
  2422.   this.message = message;
  2423.   this.viewIndex = viewIndex;
  2424.   this.currentThreadID = currentThreadID;
  2425.   this.activeThreadID = activeThreadID;
  2426.   this.QueryString = "";
  2427.   if (isUndefined_disc (pageURLToUse))
  2428.     {
  2429.       this.pageURLToUse = config.getMainPagePath ();
  2430.     }
  2431.   else
  2432.     {
  2433.       this.pageURLToUse = pageURLToUse;
  2434.     }
  2435.  
  2436.   return this;
  2437. }
  2438.  
  2439. // ======================================================================
  2440. //
  2441. // Interface to private member variables.
  2442. //
  2443. // ======================================================================
  2444.  
  2445. function getMessage_exp_disc ()
  2446. {
  2447.   return this.message;
  2448. }
  2449.  
  2450. function setMessage_exp_disc (newMessage)
  2451. {
  2452.   this.message = newMessage;
  2453.   return;
  2454. }
  2455.  
  2456. function getViewIndex_exp_disc ()
  2457. {
  2458.   return this.viewIndex;
  2459. }
  2460.  
  2461. function setViewIndex_exp_disc (newViewIndex)
  2462. {
  2463.   this.viewIndex = newViewIndex;
  2464.   return;
  2465. }
  2466.  
  2467. function getCurrentThreadID_exp_disc ()
  2468. {
  2469.   return this.currentThreadID;
  2470. }
  2471.  
  2472. function setCurrentThreadID_exp_disc (newCurrentThreadID)
  2473. {
  2474.   this.currentThreadID = newCurrentThreadID;
  2475.   return;
  2476. }
  2477.  
  2478. function getActiveThreadID_exp_disc ()
  2479. {
  2480.   return this.activeThreadID;
  2481. }
  2482.  
  2483. function setActiveThreadID_exp_disc (newActiveThreadID)
  2484. {
  2485.   this.activeThreadID = newActiveThreadID;
  2486.   return;
  2487. }
  2488.  
  2489. function getQueryString_exp_disc ()
  2490. {
  2491.   return this.QueryString;
  2492. }
  2493.  
  2494. function setQueryString_exp_disc (newQueryString)
  2495. {
  2496.   this.QueryString = newQueryString;
  2497.   return;
  2498. }
  2499.  
  2500. // ======================================================================
  2501. //
  2502. // Main object methods.
  2503. //
  2504. // ======================================================================
  2505.  
  2506. function getIcon_exp_disc ()
  2507. {
  2508.   var toggle = "";
  2509.   if (config.ADMINSWITCH_ShowExpandCollapse)
  2510.     {
  2511.       if (0 == this.message.getNumChildren ())
  2512.     {
  2513.       toggle = this.getNoExpandToggle();
  2514.     }
  2515.       else
  2516.     {
  2517.       if (((this.currentThreadID == this.activeThreadID) || (this.viewIndex <= config.ADMINSETTING_StaticViewExpandFirstNThreads)) && !(this.doWeCollapse()))
  2518.         {
  2519.           toggle = this.getCollapseToggle();
  2520.         }
  2521.       else
  2522.         {
  2523.           toggle = this.getExpandToggle();
  2524.         }
  2525.     }
  2526.     }
  2527.  
  2528.   return toggle;
  2529. }
  2530.  
  2531. function getDHTMLIcon_exp_disc (currentIndentLevel)
  2532. {
  2533.   var toggle;
  2534.  
  2535.   if (0 == this.message.getNumChildren ())
  2536.     {
  2537.       toggle = ASPFHTML.IMG (config.ADMINSETTING_NoExpandImagePathname, " ", 0, config.ADMINSETTING_NoExpandImageWidth, config.ADMINSETTING_NoExpandImageHeight, this.message.getMessageID (), this.message.getMessageID (), config.SYS_DHTMLEventHandler) + ASPFHTML.NBSP ();
  2538.     }
  2539.   else
  2540.     {
  2541.       if (currentIndentLevel == 1)
  2542.     {
  2543.       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 ();
  2544.     }
  2545.       else
  2546.     {
  2547.       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 ();
  2548.     }
  2549.     }
  2550.  
  2551.   return toggle;
  2552. }
  2553.  
  2554. function getNoExpandToggle_exp_disc ()
  2555. {
  2556.   return ASPFHTML.IMG (config.ADMINSETTING_NoExpandImagePathname, " ", 0, config.ADMINSETTING_NoExpandImageWidth, config.ADMINSETTING_NoExpandImageHeight, this.message.getMessageID (), this.message.getMessageID (), "") + ASPFHTML.NBSP ();
  2557. }
  2558.  
  2559. function getExpandLinkTag_exp_disc ()
  2560. {
  2561.   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 ());
  2562. }
  2563.  
  2564. function getExpandToggle_exp_disc ()
  2565. {
  2566.   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 ();
  2567. }
  2568.  
  2569. function getCollapseLinkTag_exp_disc ()
  2570. {
  2571.   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 ());
  2572. }
  2573.  
  2574. function getCollapseToggle_exp_disc ()
  2575. {
  2576.   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 ();
  2577. }
  2578.  
  2579. function getExpandURL_exp_disc ()
  2580. {
  2581.   var URL = this.pageURLToUse;
  2582.   var URLToUse = "";
  2583.  
  2584.   if (this.stripThisIDFromQString())
  2585.     {
  2586.       URLToUse = (this.queryString == "" ? config.getMainPagePreferredPath () : URL + "?" + this.queryString);
  2587.     }
  2588.   else
  2589.     {
  2590.       URLToUse = URL + "?" + config.FORM_QueryStringViewExpand + "=" + this.message.getMessageID () + (this.queryString == "" ? "" : "&" + this.queryString);
  2591.     }
  2592.  
  2593.   return URLToUse;
  2594. }
  2595.  
  2596. function getCollapseURL_exp_disc ()
  2597. {
  2598.   var URL = this.pageURLToUse;
  2599.   var URLToUse = "";
  2600.  
  2601.   if (this.stripThisIDFromQString())
  2602.     {
  2603.       URLToUse = (this.queryString == "" ? config.getMainPagePreferredPath () : URL + "?" + this.queryString);
  2604.     }
  2605.   else
  2606.     {
  2607.       URLToUse = URL + "?" + config.FORM_QueryStringViewCollapse + "=" + this.message.getMessageID () + (this.queryString == "" ? "" : "&" + this.queryString);
  2608.     }
  2609.  
  2610.   return URLToUse;
  2611. }
  2612.  
  2613. function stripThisIDFromQString_exp_disc ()
  2614. {
  2615.   var IDRemoved = false;
  2616.   var QString = "";
  2617.   var item;
  2618.   var numitems;
  2619.  
  2620.   numitems = Request.QueryString (config.FORM_QueryStringViewExpand).count;
  2621.   for (item = 1; item <= numitems; item++)
  2622.     {
  2623.       if (Request.QueryString (config.FORM_QueryStringViewExpand)(item) == this.message.getMessageID ())
  2624.     {
  2625.       IDRemoved = true;
  2626.     }
  2627.       else
  2628.     {
  2629.       QString += config.FORM_QueryStringViewExpand + "=" + Server.URLEncode (Request.QueryString (config.FORM_QueryStringViewExpand)(item)) + "&";
  2630.     }
  2631.     }
  2632.  
  2633.   numitems = Request.QueryString (config.FORM_QueryStringViewCollapse).count;
  2634.   for (item = 1; item <= numitems; item++)
  2635.     {
  2636.       if (Request.QueryString (config.FORM_QueryStringViewCollapse)(item) == this.message.getMessageID ())
  2637.     {
  2638.       IDRemoved = true;
  2639.     }
  2640.       else
  2641.     {
  2642.       QString += config.FORM_QueryStringViewCollapse + "=" + Server.URLEncode (Request.QueryString (config.FORM_QueryStringViewCollapse)(item)) + "&";
  2643.     }
  2644.     }
  2645.  
  2646.   numitems = Request.QueryString.count;
  2647.   for (item = 1; item <= numitems; item++)
  2648.     {
  2649.       if ((Request.QueryString.Key (item) != config.FORM_QueryStringViewCollapse) && (Request.QueryString.Key (item) != config.FORM_QueryStringViewExpand) && (Request.QueryString.Key (item) != config.FORM_QueryStringViewCentre))
  2650.     {
  2651.       QString += Request.QueryString.Key (item) + "=" + Request.QueryString (item) + "&";
  2652.     }
  2653.     }
  2654.  
  2655.   this.queryString = QString.substr(0, QString.length - 1);
  2656.  
  2657.   return IDRemoved;
  2658. }
  2659.  
  2660. function doWeExpand_exp_disc ()
  2661. {
  2662.   var expand = false;
  2663.   var item;
  2664.   var numitems;
  2665.   var doExpand = false;
  2666.  
  2667.   if (config.ADMINSWITCH_ExpandAllThreads)
  2668.     {
  2669.       doExpand = true;
  2670.     }
  2671.   else
  2672.     {
  2673.       if (this.viewIndex <= config.ADMINSETTING_StaticViewExpandFirstNThreads)
  2674.     {
  2675.       doExpand = true;
  2676.     }
  2677.       else
  2678.     {
  2679.       numitems = Request.QueryString (config.FORM_QueryStringViewExpand).count;
  2680.       for (item = 1; item <= numitems; item++)
  2681.         {
  2682.           if (Request.QueryString (config.FORM_QueryStringViewExpand)(item) == this.message.getMessageID ())
  2683.         {
  2684.           expand = true;
  2685.         }
  2686.         }
  2687.  
  2688.       doExpand = expand;
  2689.     }
  2690.     }
  2691.  
  2692.   return doExpand;
  2693. }
  2694.  
  2695. function doWeCollapse_exp_disc ()
  2696. {
  2697.   var collapse = false;
  2698.   var item;
  2699.   var numitems;
  2700.  
  2701.   numitems = Request.QueryString (config.FORM_QueryStringViewCollapse).count;
  2702.   for (item = 1; item <= numitems; item++)
  2703.     {
  2704.       if (Request.QueryString (config.FORM_QueryStringViewCollapse)(item) == this.message.getMessageID ())
  2705.     {
  2706.       collapse = true;
  2707.     }
  2708.     }
  2709.  
  2710.   return collapse;
  2711. }
  2712.  
  2713. ASPFExpandCollapse.prototype.getMessage = getMessage_exp_disc;
  2714. ASPFExpandCollapse.prototype.setMessage = setMessage_exp_disc;
  2715. ASPFExpandCollapse.prototype.getViewIndex = getViewIndex_exp_disc;
  2716. ASPFExpandCollapse.prototype.setViewIndex = setViewIndex_exp_disc;
  2717. ASPFExpandCollapse.prototype.getCurrentThreadID = getCurrentThreadID_exp_disc;
  2718. ASPFExpandCollapse.prototype.setCurrentThreadID = setCurrentThreadID_exp_disc;
  2719. ASPFExpandCollapse.prototype.getActiveThreadID = getActiveThreadID_exp_disc;
  2720. ASPFExpandCollapse.prototype.setActiveThreadID = setActiveThreadID_exp_disc;
  2721. ASPFExpandCollapse.prototype.getQueryString = getQueryString_exp_disc;
  2722. ASPFExpandCollapse.prototype.setQueryString = setQueryString_exp_disc;
  2723.  
  2724. ASPFExpandCollapse.prototype.getIcon = getIcon_exp_disc;
  2725. ASPFExpandCollapse.prototype.getDHTMLIcon = getDHTMLIcon_exp_disc;
  2726. ASPFExpandCollapse.prototype.getNoExpandToggle = getNoExpandToggle_exp_disc;
  2727. ASPFExpandCollapse.prototype.getExpandLinkTag = getExpandLinkTag_exp_disc;
  2728. ASPFExpandCollapse.prototype.getExpandToggle = getExpandToggle_exp_disc;
  2729. ASPFExpandCollapse.prototype.getCollapseLinkTag = getCollapseLinkTag_exp_disc;
  2730. ASPFExpandCollapse.prototype.getCollapseToggle = getCollapseToggle_exp_disc;
  2731. ASPFExpandCollapse.prototype.getExpandURL = getExpandURL_exp_disc;
  2732. ASPFExpandCollapse.prototype.getCollapseURL = getCollapseURL_exp_disc;
  2733. ASPFExpandCollapse.prototype.stripThisIDFromQString = stripThisIDFromQString_exp_disc;
  2734. ASPFExpandCollapse.prototype.doWeExpand = doWeExpand_exp_disc;
  2735. ASPFExpandCollapse.prototype.doWeCollapse = doWeCollapse_exp_disc;
  2736. </SCRIPT>
  2737.  
  2738. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  2739. //=======================================================================
  2740. //
  2741. // "ASP Forums" - a web-based discussion forum implementation.
  2742. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  2743. //
  2744. // This library is free software; you can redistribute it and/or
  2745. // modify it under the terms of the GNU Lesser General Public
  2746. // License as published by the Free Software Foundation; either
  2747. // version 2.1 of the License, or (at your option) any later version.
  2748. //
  2749. // This library is distributed in the hope that it will be useful,
  2750. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  2751. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2752. // Lesser General Public License for more details.
  2753. //
  2754. // You should have received a copy of the GNU Lesser General Public
  2755. // License along with this library; if not, write to the Free Software
  2756. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  2757. //
  2758. //=======================================================================
  2759.  
  2760. //=======================================================================
  2761. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  2762. //=======================================================================
  2763.  
  2764. // ======================================================================
  2765. //
  2766. // FORM OBJECT
  2767. //
  2768. // ======================================================================
  2769.  
  2770. function ASPFForm (formData)
  2771. {
  2772.   this.setAllFields (formData);
  2773.  
  2774.   return this;
  2775. }
  2776.  
  2777. // ======================================================================
  2778. //
  2779. // Interface to private member variables.
  2780. //
  2781. // ======================================================================
  2782.  
  2783. function getMessageID_frm_disc ()
  2784. {
  2785.   return this.messageID;
  2786. }
  2787.  
  2788. function setMessageID_frm_disc (newMessageID)
  2789. {
  2790.   this.messageID = newMessageID;
  2791.   return;
  2792. }
  2793.  
  2794. function getSubject_frm_disc ()
  2795. {
  2796.   return this.subject;
  2797. }
  2798.  
  2799. function setSubject_frm_disc (newSubject)
  2800. {
  2801.   this.subject = newSubject;
  2802.   return;
  2803. }
  2804.  
  2805. function getBody_frm_disc ()
  2806. {
  2807.   return this.body;
  2808. }
  2809.  
  2810. function setBody_frm_disc (newBody)
  2811. {
  2812.   this.body = newBody;
  2813.   return;
  2814. }
  2815.  
  2816. function getSortCode_frm_disc ()
  2817. {
  2818.   return this.sortCode;
  2819. }
  2820.  
  2821. function setSortCode_frm_disc (newSortCode)
  2822. {
  2823.   this.sortCode = newSortCode;
  2824.   return;
  2825. }
  2826.  
  2827. function getParentID_frm_disc ()
  2828. {
  2829.   return this.parentID;
  2830. }
  2831.  
  2832. function setParentID_frm_disc (newParentID)
  2833. {
  2834.   this.parentID = newParentID;
  2835.   return;
  2836. }
  2837.  
  2838. function getThreadID_frm_disc ()
  2839. {
  2840.   return this.threadID;
  2841. }
  2842.  
  2843. function setThreadID_frm_disc (newThreadID)
  2844. {
  2845.   this.threadID = newThreadID;
  2846.   return;
  2847. }
  2848.  
  2849. function getEmailParentOnResponse_frm_disc ()
  2850. {
  2851.   return this.emailParentOnResponse;
  2852. }
  2853.  
  2854. function setEmailParentOnResponse_frm_disc (newEmailParentOnResponse)
  2855. {
  2856.   this.emailParentOnResponse = newEmailParentOnResponse;
  2857.   return;
  2858. }
  2859.  
  2860. function getSearchString_frm_disc ()
  2861. {
  2862.   return this.searchString;
  2863. }
  2864.  
  2865. function setSearchString_frm_disc (newSearchString)
  2866. {
  2867.   this.searchString = newSearchString;
  2868.   return;
  2869. }
  2870.  
  2871. function getSQLStatement_frm_disc ()
  2872. {
  2873.   return this.SQLStatement;
  2874. }
  2875.  
  2876. function setSQLStatement_frm_disc (newSQLStatement)
  2877. {
  2878.   this.SQLStatement = newSQLStatement;
  2879.   return;
  2880. }
  2881.  
  2882. function getMessageIDToDelete_frm_disc ()
  2883. {
  2884.   return this.messageIDToDelete;
  2885. }
  2886.  
  2887. function setMessageIDToDelete_frm_disc (newMessageIDToDelete)
  2888. {
  2889.   this.messageIDToDelete = newMessageIDToDelete;
  2890.   return;
  2891. }
  2892.  
  2893. function getSwitchEditableUserInfo_frm_disc ()
  2894. {
  2895.   return this.switchEditableUserInfo;
  2896. }
  2897.  
  2898. function setSwitchEditableUserInfo_frm_disc (newSwitchEditableUserInfo)
  2899. {
  2900.   this.switchEditableUserInfo = newSwitchEditableUserInfo;
  2901.   return;
  2902. }
  2903.  
  2904. function getAuthorName_frm_disc ()
  2905. {
  2906.   return this.authorName;
  2907. }
  2908.  
  2909. function setAuthorName_frm_disc (newAuthorName)
  2910. {
  2911.   this.authorName = newAuthorName;
  2912.   return;
  2913. }
  2914.  
  2915. function getAuthorEmail_frm_disc ()
  2916. {
  2917.   return this.authorEmail;
  2918. }
  2919.  
  2920. function setAuthorEmail_frm_disc (newAuthorEmail)
  2921. {
  2922.   this.authorEmail = newAuthorEmail;
  2923.   return;
  2924. }
  2925.  
  2926. function getAuthorFullname_frm_disc ()
  2927. {
  2928.   return this.authorFullname;
  2929. }
  2930.  
  2931. function setAuthorFullname_frm_disc (newAuthorFullname)
  2932. {
  2933.   this.authorFullname = newAuthorFullname;
  2934.   return;
  2935. }
  2936.  
  2937. function getArchiveDate_frm_disc ()
  2938. {
  2939.   return this.archiveDate;
  2940. }
  2941.  
  2942. function setArchiveDate_frm_disc (newArchiveDate)
  2943. {
  2944.   this.archiveDate = newArchiveDate;
  2945.   return;
  2946. }
  2947.  
  2948. // ======================================================================
  2949. //
  2950. // Main object methods.
  2951. //
  2952. // ======================================================================
  2953.  
  2954. function setAllFields_frm_disc (newForm)
  2955. {
  2956.   if (newForm instanceof ASPFMessage)
  2957.     {
  2958.       this.setAllFieldsFromMessage (newForm);
  2959.     }
  2960.   else if (newForm != null)
  2961.     {
  2962.       this.setAllFieldsFromForm (newForm);
  2963.     }
  2964.   else
  2965.     {
  2966.       this.setAllFieldsEmpty ();
  2967.     }
  2968.  
  2969.   return;
  2970. }
  2971.  
  2972. function setAllFieldsFromMessage_frm_disc (message)
  2973. {
  2974.   this.subject = message.getSubject ();
  2975.   this.body = message.getBody ();
  2976.   this.sortCode = message.getSortCode ();
  2977.   this.parentID = message.getParentID ();
  2978.   this.threadID = message.getThreadID ();
  2979.   this.messageID = message.getMessageID ();
  2980.   this.emailParentOnResponse = message.getEmailParentOnResponse ();
  2981.   this.searchString = "";
  2982.   this.SQLStatement = "";
  2983.   this.switchEditableUserInfo = config.getEditableUserInfoSwitch ();
  2984.  
  2985.   if (this.switchEditableUserInfo)
  2986.     {
  2987.       this.authorName = message.authorName;
  2988.       this.authorEmail = message.authorEmail;
  2989.       this.authorFullname = message.authorFullname;
  2990.     }
  2991.   else
  2992.     {
  2993.       this.authorName = currentUsername_disc;
  2994.       this.authorEmail = currentUserEmailAddress_disc;
  2995.       this.authorFullname = currentUserFullName_disc;
  2996.     }
  2997.  
  2998.   return;
  2999. }
  3000.  
  3001. function setAllFieldsFromForm_frm_disc (formData)
  3002. {
  3003.   this.messageID = safeStringDereference_disc (formData (config.FORM_FieldMessageID));
  3004.   this.subject = safeStringDereference_disc (formData (config.FORM_FieldSubject));
  3005.   this.body = safeStringDereference_disc (ASPFTextControl.getControlContents (formData, config.FORM_FieldMessage));
  3006.   this.sortCode = safeStringDereference_disc (formData (config.FORM_FieldSortCode));
  3007.   this.parentID = safeStringDereference_disc (formData (config.FORM_FieldParentID));
  3008.   this.threadID = safeStringDereference_disc (formData (config.FORM_FieldThreadID));
  3009.   this.emailParentOnResponse = (isUndefined_disc (formData (config.FORM_FieldEmailResponses)) ? config.getUserEmailResponsePreference (currentUsername_disc) : (formData (config.FORM_FieldEmailResponses) == config.FORM_CheckboxTrue ? true : false));
  3010.   this.searchString = safeStringDereference_disc (formData (config.FORM_FieldSearchString));
  3011.   this.SQLStatement = safeStringDereference_disc (formData (config.FORM_FieldSQLStatement));
  3012.   this.messageIDToDelete = safeStringDereference_disc (formData (config.FORM_FieldMessageIDToDelete));
  3013.   this.switchEditableUserInfo = config.getEditableUserInfoSwitch ();
  3014.   this.archiveDate = this.interpretMonthYearSubform (formData, config.FORM_FieldArchiveDate);
  3015.   this.purgeCache = (safeStringDereference_disc (formData (config.FORM_FieldPurgeCache)) == config.FORM_CheckboxTrue ? true : false);
  3016.  
  3017.   if (this.switchEditableUserInfo)
  3018.     {
  3019.       this.authorName = safeStringDereference_disc (formData (config.FORM_FieldUsername));
  3020.       this.authorEmail = safeStringDereference_disc (formData (config.FORM_FieldEmailaddress));
  3021.       this.authorFullname = safeStringDereference_disc (formData (config.FORM_FieldFullname));
  3022.     }
  3023.   else
  3024.     {
  3025.       this.authorName = currentUsername_disc;
  3026.       this.authorEmail = currentUserEmailAddress_disc;
  3027.       this.authorFullname = currentUserFullName_disc;
  3028.     }
  3029.  
  3030.   return;
  3031. }
  3032.  
  3033. function setAllFieldsEmpty_frm_disc ()
  3034. {
  3035.   this.subject = "";
  3036.   this.body = "";
  3037.   this.sortCode = "";
  3038.   this.parentID = "";
  3039.   this.threadID = "";
  3040.   this.messageID = "";
  3041.   this.emailParentOnResponse = false;
  3042.   this.searchString = "";
  3043.   this.messageIDToDelete = "";
  3044.   this.SQLStatement = "";
  3045.   this.switchEditableUserInfo = config.getEditableUserInfoSwitch ();
  3046.   this.archiveDate = undefined_disc;
  3047.   this.purgeCache = false;
  3048.  
  3049.   if (this.switchEditableUserInfo)
  3050.     {
  3051.       this.authorName = this (config.FORM_FieldUsername);
  3052.       this.authorEmail = this (config.FORM_FieldEmailaddress);
  3053.       this.authorFullname = this (config.FORM_FieldFullname);
  3054.     }
  3055.   else
  3056.     {
  3057.       this.authorName = currentUsername_disc;
  3058.       this.authorEmail = currentUserEmailAddress_disc;
  3059.       this.authorFullname = currentUserFullName_disc;
  3060.     }
  3061.  
  3062.   return;
  3063. }
  3064.  
  3065. function getSubjectInputField_frm_disc ()
  3066. {
  3067.   var subject = this.subject;
  3068.  
  3069.   return ASPFHTML.INPUT_text (config.FORM_FieldSubject, subject, config.ADMINSETTING_SubjectInputboxSize);
  3070. }
  3071.  
  3072. function getBodyInputField_frm_disc ()
  3073. {
  3074.   var body = String (this.body);
  3075.   var textcontrol = new ASPFTextControl (config.FORM_FieldMessage, body, this.formName);
  3076.   var HTMLout = textcontrol.getControl ();
  3077.  
  3078.   return HTMLout;
  3079. }
  3080.  
  3081. function getSubjectSubform_frm_disc ()
  3082. {
  3083.   var HTMLout = "";
  3084.  
  3085.   HTMLout += ASPFHTML.TR_open ();
  3086.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3087.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSubjectLabel);
  3088.   HTMLout += config.USERTEXT_POST_SubjectPrompt.weak ();
  3089.   HTMLout += ASPFHTML.SPAN_close ();
  3090.   HTMLout += ASPFHTML.TD_close ();
  3091.  
  3092.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3093.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSubject);
  3094.   HTMLout += this.getSubjectInputField ();
  3095.   HTMLout += ASPFHTML.SPAN_close ();
  3096.   HTMLout += ASPFHTML.TD_close ();
  3097.   HTMLout += ASPFHTML.TR_close ();
  3098.  
  3099.   return HTMLout;
  3100. }
  3101.  
  3102. function getBodySubform_frm_disc ()
  3103. {
  3104.   var HTMLout = "";
  3105.  
  3106.   HTMLout += ASPFHTML.TR_open ();
  3107.   HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2);
  3108.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormBodyLabel);
  3109.   HTMLout += (ASPFHTML.NBSP () + config.USERTEXT_POST_BodyPrompt).weak ();
  3110.   HTMLout += ASPFHTML.SPAN_close ();
  3111.   HTMLout += ASPFHTML.BR ();
  3112.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormBody);
  3113.   HTMLout += this.getBodyInputField ();
  3114.   HTMLout += ASPFHTML.SPAN_close ();
  3115.   HTMLout += ASPFHTML.TD_close ();
  3116.   HTMLout += ASPFHTML.TR_close ();
  3117.  
  3118.   return HTMLout;
  3119. }
  3120.  
  3121. function getEmailResponsesSubform_frm_disc ()
  3122. {
  3123.   var emailResponsesChecked;
  3124.   if ((this.emailParentOnResponse == true) || (this.emailParentOnResponse == config.FORM_CheckboxTrue))
  3125.     {
  3126.       emailResponsesChecked = config.FORM_CheckboxChecked;
  3127.     }
  3128.   else
  3129.     {
  3130.       emailResponsesChecked = config.FORM_CheckboxUnchecked;
  3131.     }
  3132.  
  3133.   var HTMLout = "";
  3134.   if (config.ADMINSWITCH_AllowEmailResponses)
  3135.     {
  3136.       HTMLout += ASPFHTML.TR_open ();
  3137.       HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2);
  3138.       HTMLout += ASPFHTML.P_open ();
  3139.       HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailResponses);
  3140.       HTMLout += ASPFHTML.INPUT_checkbox (config.FORM_FieldEmailResponses, config.FORM_CheckboxTrue, emailResponsesChecked);
  3141.       HTMLout += ASPFHTML.SPAN_close ();
  3142.       HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailResponsesLabel);
  3143.       HTMLout += config.USERTEXT_POST_EmailResponsesPrompt.weak ();
  3144.       HTMLout += ASPFHTML.SPAN_close ();
  3145.       HTMLout += ASPFHTML.P_close ();
  3146.       HTMLout += ASPFHTML.TD_close ();
  3147.       HTMLout += ASPFHTML.TR_close ();
  3148.     }
  3149.  
  3150.   return HTMLout;
  3151. }
  3152.  
  3153. function getNonEditableUserInfoSubform_frm_disc ()
  3154. {
  3155.   var HTMLout = "";
  3156.  
  3157.   var username;
  3158.   username = this.authorName.weak () + (" (" + ASPFHTML.QUOTE_open () + this.authorFullname + ASPFHTML.QUOTE_close () + ", " + this.authorEmail + ")").weak ();
  3159.  
  3160.   HTMLout += ASPFHTML.TR_open ();
  3161.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3162.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedByLabel);
  3163.   HTMLout += config.USERTEXT_POST_PostedByPrompt.weak ();
  3164.   HTMLout += ASPFHTML.SPAN_close ();
  3165.   HTMLout += ASPFHTML.TD_close ();
  3166.  
  3167.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3168.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedBy);
  3169.   HTMLout += username.strong ();
  3170.   HTMLout += ASPFHTML.SPAN_close ();
  3171.   HTMLout += ASPFHTML.TD_close ();
  3172.   HTMLout += ASPFHTML.TR_close ();
  3173.  
  3174.   return HTMLout;
  3175. }
  3176.  
  3177. function getEditableUserInfoSubform_frm_disc ()
  3178. {
  3179.   var HTMLout = "";
  3180.   HTMLout += ASPFHTML.TR_open ();
  3181.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3182.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedByLabel);
  3183.   HTMLout += config.USERTEXT_POST_PostedByPrompt.weak ();
  3184.   HTMLout += ASPFHTML.SPAN_close ();
  3185.   HTMLout += ASPFHTML.TD_close ();
  3186.  
  3187.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3188.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormPostedBy);
  3189.   HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldUsername, this.authorName, 25, 50);
  3190.   HTMLout += ASPFHTML.SPAN_close ();
  3191.   HTMLout += ASPFHTML.TD_close ();
  3192.   HTMLout += ASPFHTML.TR_close ();
  3193.  
  3194.   HTMLout += ASPFHTML.TR_open ();
  3195.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3196.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormFullNameLabel);
  3197.   HTMLout += config.USERTEXT_POST_FullnamePrompt.weak ();
  3198.   HTMLout += ASPFHTML.SPAN_close ();
  3199.   HTMLout += ASPFHTML.TD_close ();
  3200.  
  3201.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3202.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormFullName);
  3203.   HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldFullname, this.authorFullname, 25, 50);
  3204.   HTMLout += ASPFHTML.SPAN_close ();
  3205.   HTMLout += ASPFHTML.TD_close ();
  3206.   HTMLout += ASPFHTML.TR_close ();
  3207.  
  3208.   HTMLout += ASPFHTML.TR_open ();
  3209.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3210.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailAddressLabel);
  3211.   HTMLout += config.USERTEXT_POST_EmailAddressPrompt.weak ();
  3212.   HTMLout += ASPFHTML.SPAN_close ();
  3213.   HTMLout += ASPFHTML.TD_close ();
  3214.  
  3215.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  3216.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormEmailAddress);
  3217.   HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldEmailaddress, this.authorEmail, 25, 50);
  3218.   HTMLout += ASPFHTML.SPAN_close ();
  3219.   HTMLout += ASPFHTML.TD_close ();
  3220.   HTMLout += ASPFHTML.TR_close ();
  3221.  
  3222.   return HTMLout;
  3223. }
  3224.  
  3225. function getUserInfoSubform_frm_disc ()
  3226. {
  3227.   var userInfoSubform = "";
  3228.  
  3229.   if (this.switchEditableUserInfo)
  3230.     {
  3231.       userInfoSubform = this.getEditableUserInfoSubform ();
  3232.     }
  3233.   else
  3234.     {
  3235.       userInfoSubform = this.getNonEditableUserInfoSubform ();
  3236.     }
  3237.  
  3238.   return userInfoSubform;
  3239. }
  3240.  
  3241. function getDateSubform_frm_disc (fieldValue, fieldname, startYear, endYear)
  3242. {
  3243.   var HTMLout = "";
  3244.   if (isUndefined_disc (fieldValue))
  3245.     {
  3246.       fieldValue = new Date ();
  3247.     }
  3248.   else
  3249.     {
  3250.       fieldValue = new Date (fieldValue);
  3251.     }
  3252.  
  3253.   HTMLout += this.getDateElement (fieldname, fieldValue.getDate ());
  3254.   HTMLout += this.getMonthElement (fieldname, fieldValue.getMonth ());
  3255.   HTMLout += this.getYearElement (fieldname, fieldValue.getFullYear (), startYear, endYear);
  3256.  
  3257.   return HTMLout;
  3258. }
  3259.  
  3260. function getMonthYearSubform_frm_disc (fieldValue, fieldname, startYear, endYear)
  3261. {
  3262.   var HTMLout = "";
  3263.   if (isUndefined_disc (fieldValue))
  3264.     {
  3265.       fieldValue = new Date ();
  3266.     }
  3267.   else
  3268.     {
  3269.       fieldValue = new Date (fieldValue);
  3270.     }
  3271.  
  3272.   HTMLout += this.getMonthElement (fieldname, fieldValue.getMonth ());
  3273.   HTMLout += this.getYearElement (fieldname, fieldValue.getFullYear (), startYear, endYear);
  3274.  
  3275.   return HTMLout;
  3276. }
  3277.  
  3278. function getMessageForm_frm_disc (actionPath, buttonLabel)
  3279. {
  3280.   this.formName = config.FORM_MessageFormName
  3281.   var HTMLout = ASPFHTML.FORM_open (actionPath, undefined_disc, this.formName);
  3282.  
  3283.   HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldMessageID, this.messageID);
  3284.   HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldParentID, this.parentID);
  3285.   HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldThreadID, this.threadID);
  3286.   HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldSortCode, this.sortCode);
  3287.   HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldHiddenEmailOnResponse, this.emailParentOnResponse);
  3288.  
  3289.   HTMLout += ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, config.ADMINSETTING_TableFullWidth, undefined_disc, undefined_disc, 0, 0);
  3290.  
  3291.   HTMLout += this.getUserInfoSubform ();
  3292.  
  3293.   HTMLout += this.getSubjectSubform ();
  3294.  
  3295.   HTMLout += ASPFHTML.TR_open ();
  3296.   HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2);
  3297.   HTMLout += ASPFHTML.NBSP ();
  3298.   HTMLout += ASPFHTML.TD_close ();
  3299.   HTMLout += ASPFHTML.TR_close ();
  3300.  
  3301.   HTMLout += this.getBodySubform ();
  3302.  
  3303.   HTMLout += this.getEmailResponsesSubform ();
  3304.  
  3305.   HTMLout += ASPFHTML.TR_open () + ASPFHTML.TD_open (config.ADMINSETTING_TableFullWidth, undefined_disc, undefined_disc, undefined_disc, "bottom", 2);
  3306.   HTMLout += ASPFHTML.INPUT_submit (buttonLabel, buttonLabel) + ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TABLE_close ();
  3307.   HTMLout += ASPFHTML.FORM_close ();
  3308.  
  3309.   return HTMLout;
  3310. }
  3311.  
  3312. function getSearchForm_frm_disc (label)
  3313. {
  3314.   this.formName = config.FORM_SearchFormName;
  3315.   var HTMLout = ASPFHTML.FORM_open (config.getSearchPagePath (), undefined_disc, this.formName);
  3316.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSearch);
  3317.   HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldSearchString, this.searchString, "25");
  3318.   HTMLout += ASPFHTML.INPUT_submit (label, label);
  3319.   HTMLout += ASPFHTML.SPAN_close ();
  3320.   HTMLout += ASPFHTML.FORM_close ();
  3321.  
  3322.   return HTMLout;
  3323. }
  3324.  
  3325. function getSmallSearchForm_frm_disc (label)
  3326. {
  3327.   this.formName = config.FORM_SearchFormName;
  3328.   var HTMLout = ASPFHTML.FORM_open (config.getSearchPagePath (), undefined_disc, this.forumName);
  3329.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormSearchSmall);
  3330.   HTMLout += label.weakSmall ();
  3331.   HTMLout += ASPFHTML.BR ();
  3332.   HTMLout += ASPFHTML.INPUT_text (config.FORM_FieldSearchString, this.searchString, "10");
  3333.   HTMLout += ASPFHTML.SPAN_close ();
  3334.   HTMLout += ASPFHTML.FORM_close ();
  3335.  
  3336.   return HTMLout;
  3337. }
  3338.  
  3339. function getArchiveSelector_frm_disc ()
  3340. {
  3341.   this.forumName = config.FORM_ArchiveFormName;
  3342.   var HTMLout = ASPFHTML.FORM_open (config.getArchivePagePath (), "get", this.forumName);
  3343.   HTMLout += this.getMonthYearSubform (this.archiveDate, config.FORM_FieldArchiveDate, 1999, 2001);
  3344.   HTMLout += ASPFHTML.INPUT_submit (undefined_disc, config.USERTEXT_ARCHIVE_ShowResults);
  3345.   HTMLout += ASPFHTML.FORM_close ();
  3346.  
  3347.   return HTMLout;
  3348. }
  3349.  
  3350. function getAdminForm_frm_disc ()
  3351. {
  3352.   this.forumName = config.FORM_AdminDeleteFormName;
  3353.   var adminForm = ASPFHTML.FORM_open (config.getAdminPagePath (), undefined_disc, this.forumName);
  3354.   adminForm += ASPFHTML.INPUT_submit (config.USERTEXT_SQL_DeleteHierarchyButton, config.USERTEXT_SQL_DeleteHierarchyButton);
  3355.   adminForm += ASPFHTML.NBSP ();
  3356.   adminForm += ASPFHTML.INPUT_text (config.FORM_FieldMessageIDToDelete, "", 10);
  3357.   adminForm += ASPFHTML.FORM_close ();
  3358.  
  3359.   this.forumName = config.FORM_AdminPurgeFormName;
  3360.   adminForm += ASPFHTML.FORM_open (config.getAdminPagePath (), undefined_disc, this.forumName);
  3361.   adminForm += ASPFHTML.INPUT_hidden (config.FORM_FieldPurgeCache, config.FORM_CheckboxTrue);
  3362.   adminForm += ASPFHTML.INPUT_submit (config.USERTEXT_SQL_PurgeCacheButton, config.USERTEXT_SQL_PurgeCacheButton);
  3363.   adminForm += ASPFHTML.FORM_close ();
  3364.  
  3365.   this.forumName = config.FORM_AdminSQLFormName;
  3366.   adminForm += ASPFHTML.FORM_open (config.getAdminPagePath (), undefined_disc, this.forumName);
  3367.   adminForm += ASPFHTML.TEXTAREA_open (config.FORM_FieldSQLStatement, config.ADMINSETTING_TextAreaCols, config.ADMINSETTING_TextAreaRows);
  3368.   adminForm += this.SQLStatement;
  3369.   adminForm += ASPFHTML.TEXTAREA_close () + ASPFHTML.BR ();
  3370.   adminForm += ASPFHTML.INPUT_submit (config.USERTEXT_SQL_ExecutePrompt, config.USERTEXT_SQL_ExecutePrompt);
  3371.   adminForm += ASPFHTML.FORM_close ();
  3372.  
  3373.   return adminForm;
  3374. }
  3375.  
  3376. function getDateElement_frm_disc (fieldname, fieldValue)
  3377. {
  3378.   var HTMLout = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormDateElement);
  3379.   HTMLout += ASPFHTML.SELECT_open (fieldname + config.FORM_FieldDateDaySuffix);
  3380.   for (var counter = 1; counter < 32; counter++)
  3381.     {
  3382.       HTMLout += ASPFHTML.OPTION (counter, (counter == fieldValue));
  3383.       HTMLout += counter + Date.getDateSuffixByIndex (counter);
  3384.     }
  3385.  
  3386.   HTMLout += ASPFHTML.SELECT_close ();
  3387.   HTMLout += ASPFHTML.SPAN_close ();
  3388.  
  3389.   return HTMLout;
  3390. }
  3391.  
  3392. function getMonthElement_frm_disc (fieldname, fieldValue)
  3393. {
  3394.   var HTMLout = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormMonthElement);
  3395.   HTMLout += ASPFHTML.SELECT_open (fieldname + config.FORM_FieldDateMonthSuffix);
  3396.   for (var counter = 0; counter < 12; counter++)
  3397.     {
  3398.       HTMLout += ASPFHTML.OPTION (counter, (counter == fieldValue));
  3399.       HTMLout += Date.getMonthNameByIndex (counter);
  3400.     }
  3401.  
  3402.   HTMLout += ASPFHTML.SELECT_close ();
  3403.   HTMLout += ASPFHTML.SPAN_close ();
  3404.  
  3405.   return HTMLout;
  3406. }
  3407.  
  3408. function getYearElement_frm_disc (fieldname, fieldValue, startYear, endYear)
  3409. {
  3410.   var HTMLout = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassFormYearElement);
  3411.   HTMLout += ASPFHTML.SELECT_open (fieldname + config.FORM_FieldDateYearSuffix);
  3412.   for (var counter = startYear; counter < (endYear + 1); counter++)
  3413.     {
  3414.       HTMLout += ASPFHTML.OPTION (counter, (counter == fieldValue));
  3415.       HTMLout += counter;
  3416.     }
  3417.  
  3418.   HTMLout += ASPFHTML.SELECT_close ();
  3419.   HTMLout += ASPFHTML.SPAN_close ();
  3420.  
  3421.   return HTMLout;
  3422. }
  3423.  
  3424. function interpretDateSubform_frm_disc (form, fieldName)
  3425. {
  3426.   var fieldDate;
  3427.  
  3428.   if (isDefined_disc (form (fieldName + config.FORM_FieldDateMonthSuffix)))
  3429.     {
  3430.       var dateValue = safeNumberDereference_disc (form (fieldName + config.FORM_FieldDateDaySuffix));
  3431.       var monthValue = safeNumberDereference_disc (form (fieldName + config.FORM_FieldDateMonthSuffix));
  3432.       var yearValue = safeNumberDereference_disc (form (fieldName + config.FORM_FieldDateYearSuffix));
  3433.       fieldDate = new Date ();
  3434.       fieldDate.setDate (dateValue);
  3435.       fieldDate.setMonth (monthValue);
  3436.       fieldDate.setYear (yearValue);
  3437.     }
  3438.  
  3439.   return fieldDate;
  3440. }
  3441.  
  3442. function interpretMonthYearSubform_frm_disc (form, fieldName)
  3443. {
  3444.   var fieldDate;
  3445.  
  3446.   if (isDefined_disc (String (form (fieldName + config.FORM_FieldDateMonthSuffix))))
  3447.     {
  3448.       var monthValue = safeNumberDereference_disc (String (form (fieldName + config.FORM_FieldDateMonthSuffix)));
  3449.       var yearValue = safeNumberDereference_disc (String (form (fieldName + config.FORM_FieldDateYearSuffix)));
  3450.       fieldDate = new Date ();
  3451.       fieldDate.setDate (1);
  3452.       fieldDate.setMonth (monthValue);
  3453.       fieldDate.setYear (yearValue);
  3454.     }
  3455.  
  3456.   return fieldDate;
  3457. }
  3458.  
  3459. ASPFForm.prototype.getMessageID = getMessageID_frm_disc;
  3460. ASPFForm.prototype.setMessageID = setMessageID_frm_disc;
  3461. ASPFForm.prototype.getSubject = getSubject_frm_disc;
  3462. ASPFForm.prototype.setSubject = setSubject_frm_disc;
  3463. ASPFForm.prototype.getBody = getBody_frm_disc;
  3464. ASPFForm.prototype.setBody = setBody_frm_disc;
  3465. ASPFForm.prototype.getSortCode = getSortCode_frm_disc;
  3466. ASPFForm.prototype.setSortCode = setSortCode_frm_disc;
  3467. ASPFForm.prototype.getParentID = getParentID_frm_disc;
  3468. ASPFForm.prototype.setParentID = setParentID_frm_disc;
  3469. ASPFForm.prototype.getThreadID = getThreadID_frm_disc;
  3470. ASPFForm.prototype.setThreadID = setThreadID_frm_disc;
  3471. ASPFForm.prototype.getEmailParentOnResponse = getEmailParentOnResponse_frm_disc;
  3472. ASPFForm.prototype.setEmailParentOnResponse = setEmailParentOnResponse_frm_disc;
  3473. ASPFForm.prototype.getSearchString = getSearchString_frm_disc;
  3474. ASPFForm.prototype.setSearchString = setSearchString_frm_disc;
  3475. ASPFForm.prototype.getSQLStatement = getSQLStatement_frm_disc;
  3476. ASPFForm.prototype.setSQLStatement = setSQLStatement_frm_disc;
  3477. ASPFForm.prototype.getMessageIDToDelete = getMessageIDToDelete_frm_disc;
  3478. ASPFForm.prototype.setMessageIDToDelete = setMessageIDToDelete_frm_disc;
  3479. ASPFForm.prototype.getSwitchEditableUserInfo = getSwitchEditableUserInfo_frm_disc;
  3480. ASPFForm.prototype.setSwitchEditableUserInfo = setSwitchEditableUserInfo_frm_disc;
  3481. ASPFForm.prototype.getAuthorName = getAuthorName_frm_disc;
  3482. ASPFForm.prototype.setAuthorName = setAuthorName_frm_disc;
  3483. ASPFForm.prototype.getAuthorEmail = getAuthorEmail_frm_disc;
  3484. ASPFForm.prototype.setAuthorEmail = setAuthorEmail_frm_disc;
  3485. ASPFForm.prototype.getAuthorFullname = getAuthorFullname_frm_disc;
  3486. ASPFForm.prototype.setAuthorFullname = setAuthorFullname_frm_disc;
  3487. ASPFForm.prototype.getArchiveDate = getArchiveDate_frm_disc;
  3488. ASPFForm.prototype.setArchiveDate = setArchiveDate_frm_disc;
  3489.  
  3490. ASPFForm.prototype.setAllFields = setAllFields_frm_disc;
  3491. ASPFForm.prototype.setAllFieldsFromForm = setAllFieldsFromForm_frm_disc;
  3492. ASPFForm.prototype.setAllFieldsFromMessage = setAllFieldsFromMessage_frm_disc;
  3493. ASPFForm.prototype.setAllFieldsEmpty = setAllFieldsEmpty_frm_disc;
  3494. ASPFForm.prototype.getSubjectInputField = getSubjectInputField_frm_disc;
  3495. ASPFForm.prototype.getBodyInputField = getBodyInputField_frm_disc;
  3496. ASPFForm.prototype.getSubjectSubform = getSubjectSubform_frm_disc;
  3497. ASPFForm.prototype.getBodySubform = getBodySubform_frm_disc;
  3498. ASPFForm.prototype.getEmailResponsesSubform = getEmailResponsesSubform_frm_disc;
  3499. ASPFForm.prototype.getNonEditableUserInfoSubform = getNonEditableUserInfoSubform_frm_disc;
  3500. ASPFForm.prototype.getEditableUserInfoSubform = getEditableUserInfoSubform_frm_disc;
  3501. ASPFForm.prototype.getDateSubform = getDateSubform_frm_disc;
  3502. ASPFForm.prototype.getMonthYearSubform = getMonthYearSubform_frm_disc;
  3503. ASPFForm.prototype.getUserInfoSubform = getUserInfoSubform_frm_disc;
  3504. ASPFForm.prototype.getMessageForm = getMessageForm_frm_disc;
  3505. ASPFForm.prototype.getSearchForm = getSearchForm_frm_disc;
  3506. ASPFForm.prototype.getSmallSearchForm = getSmallSearchForm_frm_disc;
  3507. ASPFForm.prototype.getArchiveSelector = getArchiveSelector_frm_disc;
  3508. ASPFForm.prototype.getAdminForm = getAdminForm_frm_disc;
  3509.  
  3510. ASPFForm.prototype.getDateElement = getDateElement_frm_disc;
  3511. ASPFForm.prototype.getMonthElement = getMonthElement_frm_disc;
  3512. ASPFForm.prototype.getYearElement = getYearElement_frm_disc;
  3513. ASPFForm.prototype.interpretDateSubform = interpretDateSubform_frm_disc;
  3514. ASPFForm.prototype.interpretMonthYearSubform = interpretMonthYearSubform_frm_disc;
  3515. </SCRIPT>
  3516.  
  3517. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  3518. //=======================================================================
  3519. //
  3520. // "ASP Forums" - a web-based discussion forum implementation.
  3521. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  3522. //
  3523. // This library is free software; you can redistribute it and/or
  3524. // modify it under the terms of the GNU Lesser General Public
  3525. // License as published by the Free Software Foundation; either
  3526. // version 2.1 of the License, or (at your option) any later version.
  3527. //
  3528. // This library is distributed in the hope that it will be useful,
  3529. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  3530. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3531. // Lesser General Public License for more details.
  3532. //
  3533. // You should have received a copy of the GNU Lesser General Public
  3534. // License along with this library; if not, write to the Free Software
  3535. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  3536. //
  3537. //=======================================================================
  3538.  
  3539. //=======================================================================
  3540. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  3541. //=======================================================================
  3542.  
  3543. // ======================================================================
  3544. //
  3545. // HTML OBJECT
  3546. //
  3547. // ======================================================================
  3548.  
  3549. function ASPFHTML (tagString)
  3550. {
  3551.   this.tagSource = tagString;
  3552.  
  3553.   return this;
  3554. }
  3555.  
  3556. function A_open_html_disc (linkURL_mand, linkTitle, linkName, linkTarget, linkID)
  3557. {
  3558.   var HTMLout = "<A HREF=\"" + linkURL_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  3559.  
  3560.   if (isDefined_disc (linkTitle))
  3561.     {
  3562.       HTMLout += " TITLE=\"" + linkTitle + "\"";
  3563.     }
  3564.  
  3565.   if (isDefined_disc (linkName))
  3566.     {
  3567.       HTMLout += " NAME=\"" + linkName + "\"";
  3568.     }
  3569.  
  3570.   if (isDefined_disc (linkTarget))
  3571.     {
  3572.       HTMLout += " TARGET=\"" + linkTarget + "\"";
  3573.     }
  3574.  
  3575.   if (isDefined_disc (linkID))
  3576.     {
  3577.       HTMLout += " ID=\"" + linkID + "\"";
  3578.     }
  3579.  
  3580.   HTMLout += ">";
  3581.  
  3582.   return HTMLout;
  3583. }
  3584.  
  3585. function A_close_html_disc ()
  3586. {
  3587.   return "</A>";
  3588. }
  3589.  
  3590. function BASE_html_disc (HREF_mand)
  3591. {
  3592.   return "<BASE HREF=\"" + HREF_mand + "\">";
  3593. }
  3594.  
  3595. function BLOCKQUOTE_open_html_disc ()
  3596. {
  3597.   return "<BLOCKQUOTE CLASS=\"" + config.ADMINSETTING_CSSClass + "\">";
  3598. }
  3599.  
  3600. function BLOCKQUOTE_close_html_disc ()
  3601. {
  3602.   return "</BLOCKQUOTE>";
  3603. }
  3604.  
  3605. function BODY_open_html_disc (backgroundColour, backgroundImage, normalLinkColour, activeLinkColour, visitedLinkColour, topMargin, leftMargin, marginHeight, marginWidth)
  3606. {
  3607.   var HTMLout = "<BODY CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  3608.  
  3609.   if (isDefined_disc (backgroundColour))
  3610.     {
  3611.       HTMLout += " BGCOLOR=\"" + backgroundColour + "\"";
  3612.     }
  3613.  
  3614.   if (isDefined_disc (backgroundImage))
  3615.     {
  3616.       HTMLout += " BACKGROUND=\"" + backgroundImage + "\"";
  3617.     }
  3618.  
  3619.   if (isDefined_disc (normalLinkColour))
  3620.     {
  3621.       HTMLout += " LINK=\"" + normalLinkColour + "\"";
  3622.     }
  3623.  
  3624.   if (isDefined_disc (activeLinkColour))
  3625.     {
  3626.       HTMLout += " ALINK=\"" + activeLinkColour + "\"";
  3627.     }
  3628.  
  3629.   if (isDefined_disc (visitedLinkColour))
  3630.     {
  3631.       HTMLout += " VLINK=\"" + visitedLinkColour + "\"";
  3632.     }
  3633.  
  3634.   if (isDefined_disc (topMargin))
  3635.     {
  3636.       HTMLout += " TOPMARGIN=\"" + topMargin + "\"";
  3637.     }
  3638.  
  3639.   if (isDefined_disc (leftMargin))
  3640.     {
  3641.       HTMLout += " LEFTMARGIN=\"" + leftMargin + "\"";
  3642.     }
  3643.  
  3644.   if (isDefined_disc (marginHeight))
  3645.     {
  3646.       HTMLout += " MARGINHEIGHT=\"" + marginHeight + "\"";
  3647.     }
  3648.  
  3649.   if (isDefined_disc (marginWidth))
  3650.     {
  3651.       HTMLout += " MARGINWIDTH=\"" + marginWidth + "\"";
  3652.     }
  3653.  
  3654.   HTMLout += ">";
  3655.  
  3656.   return HTMLout;
  3657. }
  3658.  
  3659. function BODY_close_html_disc ()
  3660. {
  3661.   return "</BODY>";
  3662. }
  3663.  
  3664. function BR_html_disc ()
  3665. {
  3666.   return "<BR CLASS=\"" + config.ADMINSETTING_CSSClass + "\" />";
  3667. }
  3668.  
  3669. function DIV_open_html_disc (ID, style, alignment)
  3670. {
  3671.   var HTMLout = "<DIV CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  3672.  
  3673.   if (isDefined_disc (ID))
  3674.     {
  3675.       HTMLout += " ID=\"" + ID + "\"";
  3676.     }
  3677.  
  3678.   if (isDefined_disc (style))
  3679.     {
  3680.       HTMLout += " STYLE=\"" + style + "\"";
  3681.     }
  3682.  
  3683.   if (isDefined_disc (alignment))
  3684.     {
  3685.       HTMLout += " ALIGN=\"" + alignment + "\"";
  3686.     }
  3687.  
  3688.   HTMLout += ">";
  3689.  
  3690.   return HTMLout;
  3691. }
  3692.  
  3693. function DIV_close_html_disc ()
  3694. {
  3695.   return "</DIV>";
  3696. }
  3697.  
  3698. function DOUBLE_QUOTES_html_disc ()
  3699. {
  3700.   return """;
  3701. }
  3702.  
  3703. function DTD_html_disc ()
  3704. {
  3705.   return "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n";
  3706. }
  3707.  
  3708. function FONT_open_html_disc (size, face, colour, style)
  3709. {
  3710.   var HTMLout = "<FONT";
  3711.  
  3712.   if (isDefined_disc (size))
  3713.     {
  3714.       HTMLout += " SIZE=\"" + size + "\"";
  3715.     }
  3716.  
  3717.   if (isDefined_disc (face))
  3718.     {
  3719.       HTMLout += " FACE=\"" + face + "\"";
  3720.     }
  3721.  
  3722.   if (isDefined_disc (colour))
  3723.     {
  3724.       HTMLout += " COLOR=\"" + colour + "\"";
  3725.     }
  3726.  
  3727.   if (isDefined_disc (style))
  3728.     {
  3729.       HTMLout += " STYLE=\"" + style + "\"";
  3730.     }
  3731.  
  3732.   HTMLout += ">";
  3733.  
  3734.   return HTMLout;
  3735. }
  3736.  
  3737. function FONT_close_html_disc ()
  3738. {
  3739.   return "</FONT>";
  3740. }
  3741.  
  3742. function FORM_open_html_disc (actionURL_mand, method, name)
  3743. {
  3744.   var HTMLout = "<FORM CLASS=\"" + config.ADMINSETTING_CSSClass + "\" ACTION=\"" + actionURL_mand + "\"";
  3745.  
  3746.   if (isDefined_disc (method))
  3747.     {
  3748.       HTMLout += " METHOD=\"" + method + "\"";
  3749.     }
  3750.   else
  3751.     {
  3752.       HTMLout += " METHOD=\"post\"";
  3753.     }
  3754.  
  3755.   if (isDefined_disc (name))
  3756.     {
  3757.       HTMLout += " NAME=\"" + name + "\"";
  3758.     }
  3759.   else
  3760.     {
  3761.       HTMLout += " NAME=\"ASPF\"";
  3762.     }
  3763.  
  3764.   HTMLout += ">";
  3765.  
  3766.   return HTMLout;
  3767. }
  3768.  
  3769. function FORM_close_html_disc (actionURL_mand)
  3770. {
  3771.   return "</FORM>";
  3772. }
  3773.  
  3774. function HTML_open_html_disc ()
  3775. {
  3776.   return "<HTML CLASS=\"" + config.ADMINSETTING_CSSClass + "\">";
  3777. }
  3778.  
  3779. function HTML_close_html_disc ()
  3780. {
  3781.   return "</HTML>";
  3782. }
  3783.  
  3784. function IFRAME_open_html_disc (name_mand, ID, width, height)
  3785. {
  3786.   var HTMLout = "<IFRAME NAME=\"" + name_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  3787.   if (isDefined_disc (ID))
  3788.     {
  3789.       HTMLout += " ID=\"" + ID + "\"";
  3790.     }
  3791.  
  3792.   if (isDefined_disc (width))
  3793.     {
  3794.       HTMLout += " WIDTH=\"" + width + "\"";
  3795.     }
  3796.  
  3797.   if (isDefined_disc (height))
  3798.     {
  3799.       HTMLout += " HEIGHT=\"" + height + "\"";
  3800.     }
  3801.  
  3802.   HTMLout += ">";
  3803.  
  3804.   return HTMLout;
  3805. }
  3806.  
  3807. function IFRAME_close_html_disc ()
  3808. {
  3809.   return "</IFRAME>";
  3810. }
  3811.  
  3812. function IMG_html_disc (sourceURL_mand, altText, border, width, height, ID, name, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, align, hspace, vspace)
  3813. {
  3814.   var HTMLout = "<IMG CLASS=\"" + config.ADMINSETTING_CSSClass + "\" SRC=\"" + sourceURL_mand + "\"";
  3815.  
  3816.   if (isDefined_disc (altText))
  3817.     {
  3818.       HTMLout += " ALT=\"" + altText + "\"";
  3819.     }
  3820.  
  3821.   if (isDefined_disc (border))
  3822.     {
  3823.       HTMLout += " BORDER=\"" + border + "\"";
  3824.     }
  3825.  
  3826.   if (isDefined_disc (width))
  3827.     {
  3828.       HTMLout += " WIDTH=\"" + width + "\"";
  3829.     }
  3830.  
  3831.   if (isDefined_disc (height))
  3832.     {
  3833.       HTMLout += " HEIGHT=\"" + height + "\"";
  3834.     }
  3835.  
  3836.   if (isDefined_disc (ID))
  3837.     {
  3838.       HTMLout += " ID=\"" + ID + "\"";
  3839.     }
  3840.  
  3841.   if (isDefined_disc (name))
  3842.     {
  3843.       HTMLout += " NAME=\"" + name + "\"";
  3844.     }
  3845.  
  3846.   if (isDefined_disc (onClick))
  3847.     {
  3848.       HTMLout += " onclick=\"" + onClick + "\"";
  3849.     }
  3850.  
  3851.   if (isDefined_disc (onMouseOver))
  3852.     {
  3853.       HTMLout += " onmouseover=\"" + onMouseOver + "\"";
  3854.     }
  3855.  
  3856.   if (isDefined_disc (onMouseOut))
  3857.     {
  3858.       HTMLout += " onmouseout=\"" + onMouseOut + "\"";
  3859.     }
  3860.  
  3861.   if (isDefined_disc (onMouseDown))
  3862.     {
  3863.       HTMLout += " onmousedown=\"" + onMouseDown + "\"";
  3864.     }
  3865.  
  3866.   if (isDefined_disc (onMouseUp))
  3867.     {
  3868.       HTMLout += " onmouseup=\"" + onMouseUp + "\"";
  3869.     }
  3870.  
  3871.   if (isDefined_disc (align))
  3872.     {
  3873.       HTMLout += " align=\"" + align + "\"";
  3874.     }
  3875.  
  3876.   if (isDefined_disc (hspace))
  3877.     {
  3878.       HTMLout += " HSPACE=\"" + hspace + "\"";
  3879.     }
  3880.  
  3881.   if (isDefined_disc (vspace))
  3882.     {
  3883.       HTMLout += " VSPACE=\"" + vspace + "\"";
  3884.     }
  3885.  
  3886.   HTMLout += " />";
  3887.  
  3888.   return HTMLout;
  3889. }
  3890.  
  3891. function INPUT_checkbox_html_disc (fieldName_mand, fieldValue_mand, checkedOrNot)
  3892. {
  3893.   var HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"checkbox\"";
  3894.  
  3895.   if (isDefined_disc (checkedOrNot))
  3896.     {
  3897.       HTMLout += checkedOrNot;
  3898.     }
  3899.  
  3900.   HTMLout += " />";
  3901.  
  3902.   return HTMLout;
  3903. }
  3904.  
  3905. function INPUT_hidden_html_disc (fieldName_mand, fieldValue_mand)
  3906. {
  3907.   return "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"hidden\" />";
  3908. }
  3909.  
  3910. function INPUT_password_html_disc (fieldName_mand, fieldValue_mand, fieldSize, fieldMaxLength)
  3911. {
  3912.   var HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"password\"";
  3913.  
  3914.   if (isUndefined_disc (fieldSize))
  3915.     {
  3916.       fieldSize = config.ADMINSETTING_TextAreaRows;
  3917.     }
  3918.   HTMLout += " SIZE=\"" + fieldSize + "\"";
  3919.  
  3920.   if (isUndefined_disc (fieldMaxLength))
  3921.     {
  3922.       fieldMaxLength = config.ADMINSETTING_InputboxMaxLength;
  3923.     }
  3924.   HTMLout += " MAXLENGTH=\"" + fieldMaxLength + "\">";
  3925.  
  3926.   return HTMLout;
  3927. }
  3928.  
  3929. function INPUT_submit_html_disc (fieldName, fieldValue_mand)
  3930. {
  3931.   var HTMLout;
  3932.  
  3933.   if (ASPFTextControl.isUsed ())
  3934.     {
  3935.       HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"button\" onclick=\"submitRecord (); return false;\"";
  3936.       if (isDefined_disc (fieldName))
  3937.     {
  3938.       HTMLout += " NAME=\"" + fieldName + "\"";
  3939.     }
  3940.       HTMLout += " />";
  3941.     }
  3942.   else
  3943.     {
  3944.       HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"submit\"";
  3945.       if (isDefined_disc (fieldName))
  3946.     {
  3947.       HTMLout += " NAME=\"" + fieldName + "\"";
  3948.     }
  3949.       HTMLout += " />";
  3950.     }
  3951.  
  3952.   return HTMLout;
  3953. }
  3954.  
  3955. function INPUT_text_html_disc (fieldName_mand, fieldValue_mand, fieldSize, fieldMaxLength)
  3956. {
  3957.   var HTMLout = "<INPUT CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" VALUE=\"" + fieldValue_mand + "\" TYPE=\"text\"";
  3958.  
  3959.   if (isUndefined_disc (fieldSize))
  3960.     {
  3961.       fieldSize = config.ADMINSETTING_TextAreaRows;
  3962.     }
  3963.   HTMLout += " SIZE=\"" + fieldSize + "\"";
  3964.  
  3965.   if (isUndefined_disc (fieldMaxLength))
  3966.     {
  3967.       fieldMaxLength = config.ADMINSETTING_InputboxMaxLength;
  3968.     }
  3969.   HTMLout += " MAXLENGTH=\"" + fieldMaxLength + "\">";
  3970.  
  3971.   return HTMLout;
  3972. }
  3973.  
  3974. function LI_html_disc ()
  3975. {
  3976.   return "<LI CLASS=\"" + config.ADMINSETTING_CSSClass + "\" />";
  3977. }
  3978.  
  3979. function JS_open_html_disc ()
  3980. {
  3981.   return "\n<SCR" + "IPT LANGUAGE=\"JavaScript\">\n<" + "!--\n";
  3982. }
  3983.  
  3984. function JS_close_html_disc ()
  3985. {
  3986.   return "\n// -->\n</SCR" + "IPT>\n";
  3987. }
  3988.  
  3989. function MAILTO_html_disc (emailAddress_mand, name_mand, emailLinkText)
  3990. {
  3991.   var emailLink;
  3992.   if (config.ADMINSWITCH_ShowEmailAddresses)
  3993.     {
  3994.       emailLink = ASPFHTML.A_open ("mailto:" + emailAddress_mand, config.USERTEXT_SHOW_PopupEmailPrefix + name_mand + " (" + emailAddress_mand + ")") + emailLinkText + ASPFHTML.A_close ();
  3995.     }
  3996.   else
  3997.     {
  3998.       emailLink = name_mand;
  3999.     }
  4000.  
  4001.   return emailLink;
  4002. }
  4003.  
  4004. function NBSP_html_disc ()
  4005. {
  4006.   return " ";
  4007. }
  4008.  
  4009. function NBSP_multi_html_disc (numRequired)
  4010. {
  4011.   var multiNBSP;
  4012.  
  4013.   if (isDefined_disc (numRequired))
  4014.     {
  4015.       multiNBSP = "";
  4016.       for (var counter = 0; counter < numRequired; counter++)
  4017.     {
  4018.       multiNBSP += " ";
  4019.     }
  4020.     }
  4021.  
  4022.   return multiNBSP;
  4023. }
  4024.  
  4025. function OL_open_html_disc ()
  4026. {
  4027.   return "<OL CLASS=\"" + config.ADMINSETTING_CSSClass + "\">";
  4028. }
  4029.  
  4030. function OL_close_html_disc ()
  4031. {
  4032.   return "</OL>";
  4033. }
  4034.  
  4035. function OPTION_html_disc (value_mand, selected)
  4036. {
  4037.   if (isDefined_disc (selected) && selected)
  4038.     {
  4039.       selected = " SELECTED";
  4040.     }
  4041.   else
  4042.     {
  4043.       selected = "";
  4044.     }
  4045.  
  4046.   return "<OPTION VALUE=\"" + value_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\"" + selected + " />";
  4047. }
  4048.  
  4049. function P_open_html_disc ()
  4050. {
  4051.   return "<P CLASS=\"" + config.ADMINSETTING_CSSClass + "\">";
  4052. }
  4053.  
  4054. function P_close_html_disc ()
  4055. {
  4056.   return "</P>";
  4057. }
  4058.  
  4059. function QUOTE_open_html_disc ()
  4060. {
  4061.   return "‘";
  4062. }
  4063.  
  4064. function QUOTE_close_html_disc ()
  4065. {
  4066.   return "’";
  4067. }
  4068.  
  4069. function SELECT_open_html_disc (name_mand, onChange)
  4070. {
  4071.   var HTMLout = "<SELECT NAME=\"" + name_mand + "\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  4072.  
  4073.   if (isDefined_disc (onChange))
  4074.     {
  4075.       HTMLout += " onchange=\"" + onChange + "\"";
  4076.     }
  4077.   HTMLout += ">";
  4078.  
  4079.   return HTMLout;
  4080. }
  4081.  
  4082. function SELECT_close_html_disc ()
  4083. {
  4084.   return "</SELECT>";
  4085. }
  4086.  
  4087. function SPAN_open_html_disc (class_mand)
  4088. {
  4089.   return "<SPAN CLASS=\"" + class_mand + "\">";
  4090.  
  4091. }
  4092.  
  4093. function SPAN_close_html_disc ()
  4094. {
  4095.   return "</SPAN>";
  4096. }
  4097.  
  4098. function STRONG_open_html_disc ()
  4099. {
  4100.   return "<STRONG CLASS=\"" + config.ADMINSETTING_CSSClass + "\">";
  4101. }
  4102.  
  4103. function STRONG_close_html_disc ()
  4104. {
  4105.   return "</STRONG>";
  4106. }
  4107.  
  4108. function STYLE_open_html_disc (type)
  4109. {
  4110.   var HTMLout = "";
  4111.  
  4112.   if (isUndefined_disc (type))
  4113.     {
  4114.       type = "text/css";
  4115.     }
  4116.  
  4117.   return "<STYLE TYPE=\"" + type + "\">";
  4118. }
  4119.  
  4120. function STYLE_close_html_disc ()
  4121. {
  4122.   return "</STYLE>";
  4123. }
  4124.  
  4125. function TABLE_open_html_disc (border, width, backgroundColour, style, cellpadding, cellspacing)
  4126. {
  4127.   var HTMLout = "<TABLE CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  4128.  
  4129.   if (isDefined_disc (border))
  4130.     {
  4131.       HTMLout += " BORDER=\"" + border + "\"";
  4132.     }
  4133.  
  4134.   if (isDefined_disc (width))
  4135.     {
  4136.       HTMLout += " WIDTH=\"" + width + "\"";
  4137.     }
  4138.  
  4139.   if (isDefined_disc (backgroundColour))
  4140.     {
  4141.       HTMLout += " BGCOLOR=\"" + backgroundColour + "\"";
  4142.     }
  4143.  
  4144.   if (isDefined_disc (style))
  4145.     {
  4146.       HTMLout += " STYLE=\"" + style + "\"";
  4147.     }
  4148.  
  4149.   if (isDefined_disc (cellpadding))
  4150.     {
  4151.       HTMLout += " CELLPADDING=\"" + cellpadding + "\"";
  4152.     }
  4153.  
  4154.   if (isDefined_disc (cellspacing))
  4155.     {
  4156.       HTMLout += " CELLSPACING=\"" + cellspacing + "\"";
  4157.     }
  4158.  
  4159.   HTMLout += ">";
  4160.  
  4161.   return HTMLout;
  4162. }
  4163.  
  4164. function TABLE_close_html_disc ()
  4165. {
  4166.   return "</TABLE>";
  4167. }
  4168.  
  4169. function TD_open_html_disc (width, style, backgroundColour, alignment, vAlignment, colspan, nowrap, backgroundImage)
  4170. {
  4171.   var HTMLout = "<TD CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  4172.  
  4173.   if (isDefined_disc (width))
  4174.     {
  4175.       HTMLout += " WIDTH=\"" + width + "\"";
  4176.     }
  4177.  
  4178.   if (isDefined_disc (style))
  4179.     {
  4180.       HTMLout += " STYLE=\"" + style + "\"";
  4181.     }
  4182.  
  4183.   if (isDefined_disc (backgroundColour))
  4184.     {
  4185.       HTMLout += " BGCOLOR=\"" + backgroundColour + "\"";
  4186.     }
  4187.  
  4188.   if (isDefined_disc (alignment))
  4189.     {
  4190.       HTMLout += " ALIGN=\"" + alignment + "\"";
  4191.     }
  4192.  
  4193.   if (isDefined_disc (vAlignment))
  4194.     {
  4195.       HTMLout += " VALIGN=\"" + vAlignment + "\"";
  4196.     }
  4197.  
  4198.   if (isDefined_disc (colspan))
  4199.     {
  4200.       HTMLout += " COLSPAN=\"" + colspan + "\"";
  4201.     }
  4202.  
  4203.   if (isDefined_disc (nowrap))
  4204.     {
  4205.       if (nowrap)
  4206.     {
  4207.       HTMLout += " NOWRAP";
  4208.     }
  4209.     }
  4210.  
  4211.   if (isDefined_disc (backgroundImage))
  4212.     {
  4213.       HTMLout += " BACKGROUND=\"" + backgroundImage + "\"";
  4214.     }
  4215.  
  4216.   HTMLout += ">";
  4217.  
  4218.   return HTMLout;
  4219. }
  4220.  
  4221. function TD_close_html_disc ()
  4222. {
  4223.   return "</TD>";
  4224. }
  4225.  
  4226. function TEXTAREA_open_html_disc (fieldName_mand, columns, rows)
  4227. {
  4228.   var HTMLout = "<TEXTAREA CLASS=\"" + config.ADMINSETTING_CSSClass + "\" NAME=\"" + fieldName_mand + "\" WRAP=\"PHYSICAL\"";
  4229.  
  4230.   if (isDefined_disc (columns))
  4231.     {
  4232.       HTMLout += " COLS=\"" + columns + "\"";
  4233.     }
  4234.  
  4235.   if (isDefined_disc (rows))
  4236.     {
  4237.       HTMLout += " ROWS=\"" + rows + "\"";
  4238.     }
  4239.  
  4240.   HTMLout += ">";
  4241.  
  4242.   return HTMLout;
  4243. }
  4244.  
  4245. function TEXTAREA_close_html_disc ()
  4246. {
  4247.   return "</TEXTAREA>";
  4248. }
  4249.  
  4250. function TH_open_html_disc (style, alignment, vAlignment, nowrap)
  4251. {
  4252.   var HTMLout = "<TH CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  4253.  
  4254.   if (isDefined_disc (style))
  4255.     {
  4256.       HTMLout += " STYLE=\"" + style + "\"";
  4257.     }
  4258.  
  4259.   if (isDefined_disc (alignment))
  4260.     {
  4261.       HTMLout += " ALIGN=\"" + alignment + "\"";
  4262.     }
  4263.  
  4264.   if (isDefined_disc (vAlignment))
  4265.     {
  4266.       HTMLout += " VALIGN=\"" + vAlignment + "\"";
  4267.     }
  4268.  
  4269.   if (isDefined_disc (nowrap))
  4270.     {
  4271.       if (nowrap)
  4272.     {
  4273.       HTMLout += " NOWRAP";
  4274.     }
  4275.     }
  4276.  
  4277.   HTMLout += ">";
  4278.  
  4279.   return HTMLout;
  4280. }
  4281.  
  4282. function TH_close_html_disc ()
  4283. {
  4284.   return "</TH>";
  4285. }
  4286.  
  4287. function TR_open_html_disc (style)
  4288. {
  4289.   var HTMLout = "<TR CLASS=\"" + config.ADMINSETTING_CSSClass + "\"";
  4290.  
  4291.   if (isDefined_disc (style))
  4292.     {
  4293.       HTMLout += " STYLE=\"" + style + "\"";
  4294.     }
  4295.  
  4296.   HTMLout += ">";
  4297.  
  4298.   return HTMLout;
  4299. }
  4300.  
  4301. function TR_close_html_disc ()
  4302. {
  4303.   return "</TR>";
  4304. }
  4305.  
  4306. function UL_open_html_disc ()
  4307. {
  4308.   return "<UL TYPE=\"square\" CLASS=\"" + config.ADMINSETTING_CSSClass + "\">";
  4309. }
  4310.  
  4311. function UL_close_html_disc ()
  4312. {
  4313.   return "</UL>";
  4314. }
  4315.  
  4316. function sanitise_html_disc ()
  4317. {
  4318.   var sanitisedTag = "";
  4319.  
  4320.   if (this.isImage ())
  4321.     {
  4322.       sanitisedTag = this.sanitiseImage ();
  4323.     }
  4324.   else if (this.isLinkOpen ())
  4325.     {
  4326.       sanitisedTag = this.sanitiseLink ();
  4327.     }
  4328.   else
  4329.     {
  4330.       sanitisedTag = this.tagSource;
  4331.     }
  4332.  
  4333.   return sanitisedTag;
  4334. }
  4335.  
  4336. function isImage_html_disc ()
  4337. {
  4338.   var imageTag;
  4339.   if (this.tagSource.search ("^<\\s*IMG\\s") > -1)
  4340.     {
  4341.       imageTag = true;
  4342.     }
  4343.   else
  4344.     {
  4345.       imageTag = false;
  4346.     }
  4347.  
  4348.   return imageTag;
  4349. }
  4350.  
  4351. function isLinkOpen_html_disc ()
  4352. {
  4353.   var linkTag;
  4354.   if (this.tagSource.search ("^<\\s*A\\s") > -1)
  4355.     {
  4356.       linkTag = true;
  4357.     }
  4358.   else
  4359.     {
  4360.       linkTag = false;
  4361.     }
  4362.  
  4363.   return linkTag;
  4364. }
  4365.  
  4366. function isLinkClose_html_disc ()
  4367. {
  4368.   var linkTag;
  4369.   if (this.tagSource.search ("^<\\s*/\\s*A\\s") > -1)
  4370.     {
  4371.       linkTag = true;
  4372.     }
  4373.   else
  4374.     {
  4375.       linkTag = false;
  4376.     }
  4377.  
  4378.   return linkTag;
  4379. }
  4380.  
  4381. // ======================================================================
  4382. //
  4383. // Private member methods.
  4384. //
  4385. // ======================================================================
  4386.  
  4387. function sanitiseImage_html_disc ()
  4388. {
  4389.   var tag = this.tagSource;
  4390.  
  4391.   var src = tag.getAttribute ("src");
  4392.   var alt = tag.getAttribute ("alt");
  4393.   if (isDefined_disc (alt))
  4394.     {
  4395.       alt = config.USERTEXT_STRING_WarningUnverifiedImage + this.QUOTE_open () + alt + this.QUOTE_close ();
  4396.     }
  4397.   else
  4398.     {
  4399.       alt = config.USERTEXT_STRING_WarningUnverifiedImage;
  4400.     }
  4401.   var border = tag.getAttribute ("border");
  4402.   var align = tag.getAttribute ("align");
  4403.   var hspace = tag.getAttribute ("hspace");
  4404.   var vspace = tag.getAttribute ("vspace");
  4405.  
  4406.   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);
  4407. }
  4408.  
  4409. function sanitiseLink_html_disc ()
  4410. {
  4411.   var tag = this.tagSource;
  4412.  
  4413.   var href = tag.getAttribute ("href");
  4414.   var title = tag.getAttribute ("title");
  4415.   if (isDefined_disc (title))
  4416.     {
  4417.       title = config.USERTEXT_STRING_WarningUnverifiedLink + this.QUOTE_open () + title + this.QUOTE_close ();
  4418.     }
  4419.   else
  4420.     {
  4421.       title = config.USERTEXT_STRING_WarningUnverifiedLink;
  4422.     }
  4423.   var name = tag.getAttribute ("name");
  4424.   var id = tag.getAttribute ("id");
  4425.  
  4426.   return this.A_open (href, title, name, undefined_disc, id);
  4427. }
  4428.  
  4429. ASPFHTML.A_open = A_open_html_disc;
  4430. ASPFHTML.A_close = A_close_html_disc;
  4431. ASPFHTML.BASE = BASE_html_disc;
  4432. ASPFHTML.BLOCKQUOTE_open = BLOCKQUOTE_open_html_disc;
  4433. ASPFHTML.BLOCKQUOTE_close = BLOCKQUOTE_close_html_disc;
  4434. ASPFHTML.BODY_open = BODY_open_html_disc;
  4435. ASPFHTML.BODY_close = BODY_close_html_disc;
  4436. ASPFHTML.BR = BR_html_disc;
  4437. ASPFHTML.DIV_open = DIV_open_html_disc;
  4438. ASPFHTML.DIV_close = DIV_close_html_disc;
  4439. ASPFHTML.DOUBLE_QUOTES = DOUBLE_QUOTES_html_disc;
  4440. ASPFHTML.DTD = DTD_html_disc;
  4441. ASPFHTML.FONT_open = FONT_open_html_disc;
  4442. ASPFHTML.FONT_close = FONT_close_html_disc;
  4443. ASPFHTML.FORM_open = FORM_open_html_disc;
  4444. ASPFHTML.FORM_close = FORM_close_html_disc;
  4445. ASPFHTML.HTML_open = HTML_open_html_disc;
  4446. ASPFHTML.HTML_close = HTML_close_html_disc;
  4447. ASPFHTML.IFRAME_open = IFRAME_open_html_disc;
  4448. ASPFHTML.IFRAME_close = IFRAME_close_html_disc;
  4449. ASPFHTML.IMG = IMG_html_disc;
  4450. ASPFHTML.INPUT_checkbox = INPUT_checkbox_html_disc;
  4451. ASPFHTML.INPUT_hidden = INPUT_hidden_html_disc;
  4452. ASPFHTML.INPUT_password = INPUT_password_html_disc;
  4453. ASPFHTML.INPUT_submit = INPUT_submit_html_disc;
  4454. ASPFHTML.INPUT_text = INPUT_text_html_disc;
  4455. ASPFHTML.JS_open = JS_open_html_disc;
  4456. ASPFHTML.JS_close = JS_close_html_disc;
  4457. ASPFHTML.LI = LI_html_disc;
  4458. ASPFHTML.MAILTO = MAILTO_html_disc;
  4459. ASPFHTML.NBSP = NBSP_html_disc;
  4460. ASPFHTML.NBSP_multi = NBSP_multi_html_disc;
  4461. ASPFHTML.OL_open = OL_open_html_disc;
  4462. ASPFHTML.OL_close = OL_close_html_disc;
  4463. ASPFHTML.OPTION = OPTION_html_disc;
  4464. ASPFHTML.P_open = P_open_html_disc;
  4465. ASPFHTML.P_close = P_close_html_disc;
  4466. ASPFHTML.QUOTE_open = QUOTE_open_html_disc;
  4467. ASPFHTML.QUOTE_close = QUOTE_close_html_disc;
  4468. ASPFHTML.SELECT_open = SELECT_open_html_disc;
  4469. ASPFHTML.SELECT_close = SELECT_close_html_disc;
  4470. ASPFHTML.SPAN_open = SPAN_open_html_disc;
  4471. ASPFHTML.SPAN_close = SPAN_close_html_disc;
  4472. ASPFHTML.STRONG_open = STRONG_open_html_disc;
  4473. ASPFHTML.STYLE_open = STYLE_open_html_disc;
  4474. ASPFHTML.STYLE_close = STYLE_close_html_disc;
  4475. ASPFHTML.STRONG_close = STRONG_close_html_disc;
  4476. ASPFHTML.TABLE_open = TABLE_open_html_disc;
  4477. ASPFHTML.TABLE_close = TABLE_close_html_disc;
  4478. ASPFHTML.TD_open = TD_open_html_disc;
  4479. ASPFHTML.TD_close = TD_close_html_disc;
  4480. ASPFHTML.TEXTAREA_open = TEXTAREA_open_html_disc;
  4481. ASPFHTML.TEXTAREA_close = TEXTAREA_close_html_disc;
  4482. ASPFHTML.TH_open = TH_open_html_disc;
  4483. ASPFHTML.TH_close = TH_close_html_disc;
  4484. ASPFHTML.TR_open = TR_open_html_disc;
  4485. ASPFHTML.TR_close = TR_close_html_disc;
  4486. ASPFHTML.UL_open = UL_open_html_disc;
  4487. ASPFHTML.UL_close = UL_close_html_disc;
  4488.  
  4489. ASPFHTML.prototype.A_open = A_open_html_disc;
  4490. ASPFHTML.prototype.A_close = A_close_html_disc;
  4491. ASPFHTML.prototype.BASE = BASE_html_disc;
  4492. ASPFHTML.prototype.BLOCKQUOTE_open = BLOCKQUOTE_open_html_disc;
  4493. ASPFHTML.prototype.BLOCKQUOTE_close = BLOCKQUOTE_close_html_disc;
  4494. ASPFHTML.prototype.BODY_open = BODY_open_html_disc;
  4495. ASPFHTML.prototype.BODY_close = BODY_close_html_disc;
  4496. ASPFHTML.prototype.BR = BR_html_disc;
  4497. ASPFHTML.prototype.DIV_open = DIV_open_html_disc;
  4498. ASPFHTML.prototype.DIV_close = DIV_close_html_disc;
  4499. ASPFHTML.prototype.DOUBLE_QUOTES = DOUBLE_QUOTES_html_disc;
  4500. ASPFHTML.prototype.DTD = DTD_html_disc;
  4501. ASPFHTML.prototype.FONT_open = FONT_open_html_disc;
  4502. ASPFHTML.prototype.FONT_close = FONT_close_html_disc;
  4503. ASPFHTML.prototype.FORM_open = FORM_open_html_disc;
  4504. ASPFHTML.prototype.FORM_close = FORM_close_html_disc;
  4505. ASPFHTML.prototype.HTML_open = HTML_open_html_disc;
  4506. ASPFHTML.prototype.HTML_close = HTML_close_html_disc;
  4507. ASPFHTML.prototype.IFRAME_open = IFRAME_open_html_disc;
  4508. ASPFHTML.prototype.IFRAME_close = IFRAME_close_html_disc;
  4509. ASPFHTML.prototype.IMG = IMG_html_disc;
  4510. ASPFHTML.prototype.INPUT_checkbox = INPUT_checkbox_html_disc;
  4511. ASPFHTML.prototype.INPUT_hidden = INPUT_hidden_html_disc;
  4512. ASPFHTML.prototype.INPUT_password = INPUT_password_html_disc;
  4513. ASPFHTML.prototype.INPUT_submit = INPUT_submit_html_disc;
  4514. ASPFHTML.prototype.INPUT_text = INPUT_text_html_disc;
  4515. ASPFHTML.prototype.JS_open = JS_open_html_disc;
  4516. ASPFHTML.prototype.JS_close = JS_close_html_disc;
  4517. ASPFHTML.prototype.LI = LI_html_disc;
  4518. ASPFHTML.prototype.MAILTO = MAILTO_html_disc;
  4519. ASPFHTML.prototype.NBSP = NBSP_html_disc;
  4520. ASPFHTML.prototype.NBSP_multi = NBSP_multi_html_disc;
  4521. ASPFHTML.prototype.OPTION = OPTION_html_disc;
  4522. ASPFHTML.prototype.OL_open = OL_open_html_disc;
  4523. ASPFHTML.prototype.OL_close = OL_close_html_disc;
  4524. ASPFHTML.prototype.P_open = P_open_html_disc;
  4525. ASPFHTML.prototype.P_close = P_close_html_disc;
  4526. ASPFHTML.prototype.QUOTE_open = QUOTE_open_html_disc;
  4527. ASPFHTML.prototype.QUOTE_close = QUOTE_close_html_disc;
  4528. ASPFHTML.prototype.SELECT_open = SELECT_open_html_disc;
  4529. ASPFHTML.prototype.SELECT_close = SELECT_close_html_disc;
  4530. ASPFHTML.prototype.STRONG_open = STRONG_open_html_disc;
  4531. ASPFHTML.prototype.SPAN_open = SPAN_open_html_disc;
  4532. ASPFHTML.prototype.SPAN_close = SPAN_close_html_disc;
  4533. ASPFHTML.prototype.STRONG_close = STRONG_close_html_disc;
  4534. ASPFHTML.prototype.STYLE_open = STYLE_open_html_disc;
  4535. ASPFHTML.prototype.STYLE_close = STYLE_close_html_disc;
  4536. ASPFHTML.prototype.TABLE_open = TABLE_open_html_disc;
  4537. ASPFHTML.prototype.TABLE_close = TABLE_close_html_disc;
  4538. ASPFHTML.prototype.TD_open = TD_open_html_disc;
  4539. ASPFHTML.prototype.TD_close = TD_close_html_disc;
  4540. ASPFHTML.prototype.TEXTAREA_open = TEXTAREA_open_html_disc;
  4541. ASPFHTML.prototype.TEXTAREA_close = TEXTAREA_close_html_disc;
  4542. ASPFHTML.prototype.TH_open = TH_open_html_disc;
  4543. ASPFHTML.prototype.TH_close = TH_close_html_disc;
  4544. ASPFHTML.prototype.TR_open = TR_open_html_disc;
  4545. ASPFHTML.prototype.TR_close = TR_close_html_disc;
  4546. ASPFHTML.prototype.UL_open = UL_open_html_disc;
  4547. ASPFHTML.prototype.UL_close = UL_close_html_disc;
  4548.  
  4549. ASPFHTML.prototype.sanitise = sanitise_html_disc;
  4550. ASPFHTML.prototype.isImage = isImage_html_disc;
  4551. ASPFHTML.prototype.isLinkOpen = isLinkOpen_html_disc;
  4552. ASPFHTML.prototype.isLinkClose = isLinkClose_html_disc;
  4553. ASPFHTML.prototype.sanitiseImage = sanitiseImage_html_disc;
  4554. ASPFHTML.prototype.sanitiseLink = sanitiseLink_html_disc;
  4555.  
  4556. </SCRIPT>
  4557.  
  4558. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  4559. //=======================================================================
  4560. //
  4561. // "ASP Forums" - a web-based discussion forum implementation.
  4562. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  4563. //
  4564. // This library is free software; you can redistribute it and/or
  4565. // modify it under the terms of the GNU Lesser General Public
  4566. // License as published by the Free Software Foundation; either
  4567. // version 2.1 of the License, or (at your option) any later version.
  4568. //
  4569. // This library is distributed in the hope that it will be useful,
  4570. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  4571. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4572. // Lesser General Public License for more details.
  4573. //
  4574. // You should have received a copy of the GNU Lesser General Public
  4575. // License along with this library; if not, write to the Free Software
  4576. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  4577. //
  4578. //=======================================================================
  4579.  
  4580. //=======================================================================
  4581. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  4582. //=======================================================================
  4583.  
  4584. // ======================================================================
  4585. //
  4586. // MESSAGE OBJECT
  4587. //
  4588. // ======================================================================
  4589.  
  4590. function ASPFMessage (message)
  4591. {
  4592.   this.setAllFields (message);
  4593.  
  4594.   return this;
  4595. }
  4596.  
  4597. // ======================================================================
  4598. //
  4599. // Interface to private member variables.
  4600. //
  4601. // ======================================================================
  4602.  
  4603. function getSubject_msg_disc ()
  4604. {
  4605.   return this.subject;
  4606. }
  4607.  
  4608. function setSubject_msg_disc (newSubject)
  4609. {
  4610.   this.subject = newSubject;
  4611.   return;
  4612. }
  4613.  
  4614. function getBody_msg_disc ()
  4615. {
  4616.   return this.body;
  4617. }
  4618.  
  4619. function setBody_msg_disc (newBody)
  4620. {
  4621.   this.body = newBody;
  4622.   return;
  4623. }
  4624.  
  4625. function getSortCode_msg_disc ()
  4626. {
  4627.   return this.sortCode;
  4628. }
  4629.  
  4630. function setSortCode_msg_disc (newSortCode)
  4631. {
  4632.   this.sortCode = newSortCode;
  4633.   return;
  4634. }
  4635.  
  4636. function getAuthorName_msg_disc ()
  4637. {
  4638.   return this.authorName;
  4639. }
  4640.  
  4641. function setAuthorName_msg_disc (newAuthorName)
  4642. {
  4643.   this.authorName = newAuthorName;
  4644.   return;
  4645. }
  4646.  
  4647. function getAuthorEmail_msg_disc ()
  4648. {
  4649.   return this.authorEmail;
  4650. }
  4651.  
  4652. function setAuthorEmail_msg_disc (newAuthorEmail)
  4653. {
  4654.   this.authorEmail = newAuthorEmail;
  4655.   return;
  4656. }
  4657.  
  4658. function getAuthorFullname_msg_disc ()
  4659. {
  4660.   return this.authorFullname;
  4661. }
  4662.  
  4663. function setAuthorFullname_msg_disc (newAuthorFullname)
  4664. {
  4665.   this.authorFullname = newAuthorFullname;
  4666.   return;
  4667. }
  4668.  
  4669. function getMessageID_msg_disc ()
  4670. {
  4671.   return this.messageID;
  4672. }
  4673.  
  4674. function setMessageID_msg_disc (newMessageID)
  4675. {
  4676.   this.messageID = newMessageID;
  4677.   return;
  4678. }
  4679.  
  4680. function getParentID_msg_disc ()
  4681. {
  4682.   return this.parentID;
  4683. }
  4684.  
  4685. function setParentID_msg_disc (newParentID)
  4686. {
  4687.   this.parentID = newParentID;
  4688.   return;
  4689. }
  4690.  
  4691. function getThreadID_msg_disc ()
  4692. {
  4693.   return this.threadID;
  4694. }
  4695.  
  4696. function setThreadID_msg_disc (newThreadID)
  4697. {
  4698.   this.threadID = newThreadID;
  4699.   return;
  4700. }
  4701.  
  4702. function getNumChildren_msg_disc ()
  4703. {
  4704.   return this.numChildren;
  4705. }
  4706.  
  4707. function setNumChildren_msg_disc (newNumChildren)
  4708. {
  4709.   this.numChildren = newNumChildren;
  4710.   return;
  4711. }
  4712.  
  4713. function getDateCreated_msg_disc ()
  4714. {
  4715.   return new Date (this.dateCreated);
  4716. }
  4717.  
  4718. function setDateCreated_msg_disc (newDateCreated)
  4719. {
  4720.   this.dateCreated = newDateCreated;
  4721.   return;
  4722. }
  4723.  
  4724. function getDateModified_msg_disc ()
  4725. {
  4726.   return new Date (this.dateModified);
  4727. }
  4728.  
  4729. function setDateModified_msg_disc (newDateModified)
  4730. {
  4731.   this.dateModified = newDateModified;
  4732.   return;
  4733. }
  4734.  
  4735. function getEmailParentOnResponse_msg_disc ()
  4736. {
  4737.   var emailResponse = false;
  4738.   if ((this.emailParentOnResponse == "true") || (this.emailParentOnResponse == true))
  4739.     {
  4740.       emailResponse = true;
  4741.     }
  4742.  
  4743.   return emailResponse;
  4744. }
  4745.  
  4746. function setEmailParentOnResponse_msg_disc (newEmailParentOnResponse)
  4747. {
  4748.   this.emailParentOnResponse = newEmailParentOnResponse;
  4749.   return;
  4750. }
  4751.  
  4752. // ======================================================================
  4753. //
  4754. // Main object methods.
  4755. //
  4756. // ======================================================================
  4757.  
  4758. function setAllFieldsEmpty_msg_disc ()
  4759. {
  4760.   this.subject = "";
  4761.   this.body = "";
  4762.   this.sortCode = "";
  4763.   this.authorName = "";
  4764.   this.authorEmail = "";
  4765.   this.authorFullname = "";
  4766.   this.messageID = 0;
  4767.   this.parentID = 0;
  4768.   this.threadID = 0;
  4769.   this.numChildren = 0;
  4770.   this.dateCreated = new Date ("1/1/00");
  4771.   this.dateModified = new Date ("1/1/00");
  4772.   this.emailParentOnResponse = false;
  4773.  
  4774.   return;
  4775. }
  4776.  
  4777. function setAllFieldsFromRecordSet_msg_disc (newMessageRecord)
  4778. {
  4779.   if ((newMessageRecord != null) && (!newMessageRecord.EOF))
  4780.     {
  4781.       var dBase = new ASPFDatabase ();
  4782.  
  4783.       this.subject = dBase.getSubjectField (newMessageRecord);
  4784.       this.body = dBase.getBodyField (newMessageRecord);
  4785.       this.sortCode = dBase.getSortCodeField (newMessageRecord);
  4786.       this.authorName = dBase.getAuthorNameField (newMessageRecord);
  4787.       this.authorEmail = dBase.getAuthorEmailField (newMessageRecord);
  4788.       this.authorFullname = dBase.getAuthorFullnameField (newMessageRecord);
  4789.       this.messageID = dBase.getMessageIDField (newMessageRecord).Value;
  4790.       this.parentID = dBase.getParentIDField (newMessageRecord).Value;
  4791.       this.threadID = dBase.getThreadIDField (newMessageRecord).Value;
  4792.       this.numChildren = dBase.getNumChildrenField (newMessageRecord).Value;
  4793.       this.dateCreated = dBase.getDateCreatedField (newMessageRecord);
  4794.       this.dateModified = dBase.getDateModifiedField (newMessageRecord);
  4795.       this.emailParentOnResponse = dBase.getEmailParentOnResponseField (newMessageRecord).Value;
  4796.  
  4797.       delete dBase;
  4798.     }
  4799.   else
  4800.     {
  4801.       this.setAllFieldsEmpty ();
  4802.     }
  4803.  
  4804.   return;
  4805. }
  4806.  
  4807. function setAllFieldsFromMessage_msg_disc (newMessage)
  4808. {
  4809.   this.subject = newMessage.getSubject ();
  4810.   this.body = newMessage.getBody ();
  4811.   this.sortCode = newMessage.getSortCode ();
  4812.   this.authorName = newMessage.getAuthorName ();
  4813.   this.authorEmail = newMessage.getAuthorEmail ();
  4814.   this.authorFullname = newMessage.getAuthorFullname ();
  4815.   this.messageID = newMessage.getMessageID ();
  4816.   this.parentID = newMessage.getParentID ();
  4817.   this.threadID = newMessage.getThreadID ();
  4818.   this.numChildren = newMessage.getNumChildren ();
  4819.   this.dateCreated = newMessage.getDateCreated ();
  4820.   this.dateModified = newMessage.getDateModified ();
  4821.   this.emailParentOnResponse = newMessage.getEmailParentOnResponse ();
  4822.  
  4823.   return;
  4824. }
  4825.  
  4826. function setAllFieldsFromForm_msg_disc (newMessageForm)
  4827. {
  4828.   this.subject = safeStringDereference_disc (newMessageForm.getSubject ());
  4829.   this.body = safeStringDereference_disc (newMessageForm.getBody ());
  4830.   this.sortCode = safeNumberDereference_disc (newMessageForm.getSortCode ());
  4831.   this.parentID = safeNumberDereference_disc (newMessageForm.getParentID ());
  4832.   this.threadID = safeNumberDereference_disc (newMessageForm.getThreadID ());
  4833.   this.messageID = safeNumberDereference_disc (newMessageForm.getMessageID ());
  4834.   this.emailParentOnResponse = safeStringDereference_disc (newMessageForm.getEmailParentOnResponse ());
  4835.   this.authorName = safeStringDereference_disc (newMessageForm.getAuthorName ());
  4836.   this.authorEmail = safeStringDereference_disc (newMessageForm.getAuthorEmail ());
  4837.   this.authorFullname = safeStringDereference_disc (newMessageForm.getAuthorFullname ());
  4838.  
  4839.   return;
  4840. }
  4841.  
  4842. function setAllFields_msg_disc (newMessage)
  4843. {
  4844.   if (newMessage instanceof ASPFForm)
  4845.     {
  4846.       this.setAllFieldsFromForm (newMessage);
  4847.     }
  4848.   else if (newMessage instanceof ASPFMessage)
  4849.     {
  4850.       this.setAllFieldsFromMessage (newMessage);
  4851.     }
  4852.   else
  4853.     {
  4854.       this.setAllFieldsFromRecordSet (newMessage);
  4855.     }
  4856.  
  4857.   return;
  4858. }
  4859.  
  4860. function getExpandCollapse_msg_disc (viewIndex, activeThreadID, pageURLToUse)
  4861. {
  4862.   var expandCollapse = new ASPFExpandCollapse (this, viewIndex, 0, activeThreadID, pageURLToUse);
  4863.   var HTMLout = ASPFHTML.FONT_open (2) + expandCollapse.getIcon() + ASPFHTML.FONT_close () + ASPFHTML.TD_close () + ASPFHTML.TD_open ();
  4864.  
  4865.   delete expandCollapse;
  4866.   return HTMLout;
  4867. }
  4868.  
  4869. function getDHTMLExpandCollapse_msg_disc (currentIndentLevel, pageURLToUse)
  4870. {
  4871.   var expandCollapse = new ASPFExpandCollapse (this, 0, 0, 0, pageURLToUse);
  4872.   var HTMLout = ASPFHTML.FONT_open (2) + expandCollapse.getDHTMLIcon (currentIndentLevel) + ASPFHTML.FONT_close () + ASPFHTML.TD_close () + ASPFHTML.TD_open ();
  4873.  
  4874.   delete expandCollapse;
  4875.   return HTMLout;
  4876. }
  4877.  
  4878. function getViewEntry_msg_disc (activeMessageID)
  4879. {
  4880.   var subjectLineString = ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewSubject);
  4881.  
  4882.   if (Number (activeMessageID) == Number (this.messageID))
  4883.     {
  4884.       subjectLineString += this.subject.strong();
  4885.     }
  4886.   else
  4887.     {
  4888.       subjectLineString += this.getSubjectLink().strong();
  4889.     }
  4890.  
  4891.   subjectLineString += ASPFHTML.SPAN_close ();
  4892.  
  4893.   subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewAuthor);
  4894.   subjectLineString += config.USERTEXT_VIEW_SeparateSubjectAuthor + String (this.authorFullname).strongSmall();
  4895.   subjectLineString += " (" +  ASPFHTML.QUOTE_open ();
  4896.   subjectLineString += ASPFHTML.MAILTO (this.authorEmail, this.authorName, this.authorName);
  4897.   subjectLineString += ASPFHTML.QUOTE_close () + ") ";
  4898.   subjectLineString += ASPFHTML.SPAN_close ();
  4899.   subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewDate);
  4900.   subjectLineString += config.USERTEXT_VIEW_SeparateAuthorDate + this.getDateCreated ().getShortFormat ();
  4901.   subjectLineString += ASPFHTML.SPAN_close ();
  4902.  
  4903.   if (this.numChildren == 0)
  4904.     {
  4905.       subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewNoChildren);
  4906.       subjectLineString += " ("  + config.USERTEXT_VIEW_NoRepliesTag + ")";
  4907.       subjectLineString += ASPFHTML.SPAN_close ();
  4908.     }
  4909.   else if (this.numChildren == 1)
  4910.     {
  4911.       subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewOneChild);
  4912.       subjectLineString += " (" + this.numChildren + config.USERTEXT_VIEW_OneReplyTag + ")";
  4913.       subjectLineString += ASPFHTML.SPAN_close ();
  4914.     }
  4915.   else
  4916.     {
  4917.       subjectLineString += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassViewManyChildren);
  4918.       subjectLineString += " (" + this.numChildren + config.USERTEXT_VIEW_ManyRepliesTag + ")";
  4919.       subjectLineString += ASPFHTML.SPAN_close ();
  4920.     }
  4921.  
  4922.   subjectLineString = subjectLineString.weakSmall();
  4923.  
  4924.   return subjectLineString;
  4925. }
  4926.  
  4927. function getSubjectLink_msg_disc ()
  4928. {
  4929.   var HTMLout;
  4930.   HTMLout = ASPFHTML.A_open (config.getShowMessagePagePath () + "?" + config.FORM_QueryStringMessageID + "=" + this.messageID, config.USERTEXT_SHOW_PopupSubjectPrefix +  ASPFHTML.QUOTE_open () + this.subject.stripAllTags () +  ASPFHTML.QUOTE_close ());
  4931.   HTMLout += this.subject;
  4932.   HTMLout += ASPFHTML.A_close ();
  4933.  
  4934.   return HTMLout;
  4935. }
  4936.  
  4937. function getSummary_msg_disc ()
  4938. {
  4939.   var dateCreated = new Date (this.dateCreated);
  4940.  
  4941.   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 ();
  4942. }
  4943.  
  4944. function sendAdminAlert_msg_disc (pureSubject, pureBody)
  4945. {
  4946.   if ("" != config.ADMINSETTING_EmailAdminAddress)
  4947.     {
  4948.       var adminEmail;
  4949.       adminEmail = new ASPFEmail ();
  4950.       adminEmail.toName = config.ADMINSETTING_EmailAdminName;
  4951.       adminEmail.toAddress = config.ADMINSETTING_EmailAdminAddress;
  4952.       adminEmail.fromName = this.authorFullname;
  4953.       adminEmail.fromAddress = this.authorEmail;
  4954.       adminEmail.subject = config.USERTEXT_MAIL_AdminNewPostSubjectPrefix + " (" + config.ADMINSETTING_ForumName + "): " + pureSubject;
  4955.       if (config.ADMINSWITCH_AllowHTMLEmail)
  4956.     {
  4957.       var HTMLBody;
  4958.       HTMLBody = config.USERTEXT_MAIL_AdminNewPostBodyPrefix + this.authorFullname + config.USERTEXT_MAIL_AdminNewPostSeparateNameForum + config.ADMINSETTING_ForumName
  4959.         HTMLBody += ASPFHTML.P_open () + this.subject.strong() + ASPFHTML.P_close ();
  4960.       HTMLBody += this.body.messageBody();
  4961.       HTMLBody += ASPFHTML.P_open () + ASPFPageElement.getNewReplyButton () + ASPFHTML.P_close ();
  4962.       adminEmail.body = adminEmail.getHTMLMessageBody (this, config.ADMINSETTING_ForumName, HTMLBody, config.ADMINSETTING_EmailAlertSignatureHTML);
  4963.  
  4964.       adminEmail.sendHTML ();
  4965.     }
  4966.       else
  4967.     {
  4968.       adminEmail.body = config.USERTEXT_MAIL_AdminNewPostBodyPrefix + this.authorFullname + 
  4969.         config.USERTEXT_MAIL_AdminNewPostSeparateNameForum + config.ADMINSETTING_ForumName + "\n\n" + pureBody.stripAllTags ();
  4970.       adminEmail.send ();
  4971.     }
  4972.       delete adminEmail;
  4973.     }
  4974.  
  4975.   return;
  4976. }
  4977.  
  4978. function sendUserAlert_msg_disc (pureSubject, pureBody)
  4979. {
  4980.   if ((config.ADMINSWITCH_AllowEmailResponses) && (this.parentID != 0))
  4981.     {
  4982.       var dBase = new ASPFDatabase ();
  4983.       var parentMessage = dBase.getMessageByID (this.parentID);
  4984.  
  4985.       if (parentMessage != null)
  4986.     {
  4987.       if (parentMessage.getEmailParentOnResponse ())
  4988.         {
  4989.           var userAlert = new ASPFEmail ();
  4990.           userAlert.subject = this.authorFullname + config.USERTEXT_MAIL_UserNewPostSeparateNameForum + config.ADMINSETTING_ForumName;
  4991.  
  4992.           userAlert.toAddress = parentMessage.getAuthorEmail ();
  4993.           userAlert.toName = parentMessage.getAuthorFullname ();
  4994.           userAlert.fromAddress = config.ADMINSETTING_EmailAlertFromAddress;
  4995.           userAlert.fromName = config.ADMINSETTING_EmailAlertFromName;
  4996.  
  4997.           var subject = pureSubject;
  4998.  
  4999.           if ((config.ADMINSWITCH_AllowHTMLEmail) && (config.getUserHTMLMailPreference (parentMessage.getAuthorName ())))
  5000.         {
  5001.           var HTMLBody;
  5002.           HTMLBody = this.authorFullname;
  5003.           HTMLBody += config.USERTEXT_MAIL_UserNewPostNameSuffix;
  5004.           HTMLBody += config.USERTEXT_MAIL_UserNewPostMessagePrefix;
  5005.           HTMLBody += ASPFHTML.P_open () + subject.strong() + ASPFHTML.P_close ();
  5006.           HTMLBody += this.body.messageBody();
  5007.           HTMLBody += ASPFHTML.P_open ();
  5008.           HTMLBody += ASPFPageElement.getNewReplyButton ();
  5009.           HTMLBody += ASPFHTML.P_close ();
  5010.  
  5011.           userAlert.body = userAlert.getHTMLMessageBody (this, config.ADMINSETTING_ForumName,
  5012.                                  HTMLBody, config.ADMINSETTING_EmailAlertSignatureHTML);
  5013.  
  5014.           userAlert.sendHTML ();
  5015.         }
  5016.           else
  5017.         {
  5018.           userAlert.body = this.authorFullname + config.USERTEXT_MAIL_UserNewPostSeparateNameMessage + subject;
  5019.           userAlert.body += "\n\n" + config.USERTEXT_MAIL_UserNewPostMessagePrefix + "\n\n\n" + subject;
  5020.           userAlert.body += "\n\n" + pureBody.stripAllTags () + "\n" + config.ADMINSETTING_EmailAlertSignature;
  5021.           userAlert.send ();
  5022.         }
  5023.  
  5024.           delete userAlert;
  5025.         }
  5026.     }
  5027.  
  5028.       delete dbase;
  5029.     }
  5030.  
  5031.   return;
  5032. }
  5033.  
  5034. function saveAsNewMessage_msg_disc (successfulMessage, failedMessagePrefix)
  5035. {
  5036.   var successful;
  5037.   var pureBody = this.body.purify ();
  5038.   var pureSubject = this.subject.purify ();
  5039.  
  5040.   this.normalisePost ();
  5041.  
  5042.   var successOrFailure = this.validatePost ();
  5043.   if (successOrFailure.number == config.CONST_NoError)
  5044.     {
  5045.       var dBase = new ASPFDatabase ();
  5046.       dBase.saveNewRecord (this);
  5047.  
  5048.       successfulMessage.strong().show ();
  5049.       currentMessage_disc = this;
  5050.       successful = true;
  5051.  
  5052.       this.sendAdminAlert (pureSubject, pureBody);
  5053.       this.sendUserAlert (pureSubject, pureBody);
  5054.  
  5055.       delete dBase;
  5056.     }
  5057.   else
  5058.     {
  5059.       failedMessagePrefix = failedMessagePrefix.paragraph ();
  5060.       failedMessagePrefix.show ();
  5061.       successOrFailure.description.show ();
  5062.       successful = false;
  5063.     }
  5064.  
  5065.   delete successOrFailure;
  5066.   return successful;
  5067. }
  5068.  
  5069. function saveAsUpdatedMessage_msg_disc (successfulMessage, failedMessagePrefix)
  5070. {
  5071.   var successful;
  5072.   var errorString;
  5073.  
  5074.   this.normalisePost();
  5075.  
  5076.   var successOrFailure = this.validatePost ();
  5077.   if (successOrFailure.number == config.CONST_NoError)
  5078.     {
  5079.       var dBase = new ASPFDatabase ();
  5080.       dBase.saveUpdatedRecord (this);
  5081.  
  5082.       successfulMessage = successfulMessage.paragraph ();
  5083.       successfulMessage.strong().show();
  5084.       successful = true;
  5085.  
  5086.       delete dBase;
  5087.     }
  5088.   else
  5089.     {
  5090.       failedMessagePrefix = failedMessagePrefix.paragraph ();
  5091.       failedMessagePrefix.show ();
  5092.       successOrFailure.description.show ();
  5093.       successful = false;
  5094.     }
  5095.  
  5096.   delete successOrFailure;
  5097.   return successful;
  5098. }
  5099.  
  5100. function saveUpdatedData_msg_disc ()
  5101. {
  5102.   var dBase = new ASPFDatabase ();
  5103.   dBase.saveUpdatedRecord (this);
  5104.  
  5105.   delete dBase;
  5106.   return;
  5107. }
  5108.  
  5109. function normalisePost_msg_disc ()
  5110. {
  5111.   this.threadID = Number (this.threadID);
  5112.   this.sortCode = String (this.sortCode).substr (0, config.DATABASE_MaxSortcodeSize);
  5113.   this.parentID = Number (this.parentID);
  5114.  
  5115.   this.emailResponses = Boolean (this.emailResponses);
  5116.   this.subject = this.subject.substr (0, config.DATABASE_MaxSubjectSize).formatForStoring ();
  5117.   this.body = this.body.substr (0, config.DATABASE_MaxMessageSize).formatForStoring ();
  5118.   this.authorName = this.authorName.substr (0, config.DATABASE_MaxUsernameSize).formatForStoring ();
  5119.   this.authorFullname = this.authorFullname.substr (0, config.DATABASE_MaxFullnameSize).formatForStoring ();
  5120.   this.authorEmailAddress = this.authorEmail.substr (0, config.DATABASE_MaxEmailAddressSize).formatForStoring ();
  5121.  
  5122.   return;
  5123. }
  5124.  
  5125. function validatePost_msg_disc ()
  5126. {
  5127.   var errors = ASPFHTML.UL_open ();
  5128.   var valid = true;
  5129.  
  5130.   if (this.authorName == "")
  5131.     {
  5132.       errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoUsername;
  5133.       valid = false;
  5134.     }
  5135.  
  5136.   if (this.authorFullname == "")
  5137.     {
  5138.       errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoName;
  5139.       valid = false;
  5140.     }
  5141.  
  5142.   if (this.authorEmail == "")
  5143.     {
  5144.       errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoEmail;
  5145.       valid = false;
  5146.     }
  5147.  
  5148.   if (this.subject == "")
  5149.     {
  5150.       errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoSubject;
  5151.       valid = false;
  5152.     }
  5153.  
  5154.   if (this.body == "")
  5155.     {
  5156.       errors += ASPFHTML.LI () + config.USERTEXT_POST_ErrorNoBody;
  5157.       valid = false;
  5158.     }
  5159.  
  5160.   errors += ASPFHTML.UL_close ();
  5161.   valid = (valid ? config.CONST_NoError : config.CONST_Error);
  5162.  
  5163.   return new Error (valid, errors);
  5164. }
  5165.  
  5166. function getRenderedHTML_msg_disc ()
  5167. {
  5168.   var HTMLout = ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, config.ADMINSETTING_TableFullWidth, undefined_disc, undefined_disc, 0, 0);
  5169.  
  5170.   var email = new ASPFEmail();
  5171.   email.fromName = this.authorFullname;
  5172.   email.fromAddress = this.authorEmail;
  5173.  
  5174.   HTMLout += ASPFHTML.TR_open ();
  5175.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  5176.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedByLabel);
  5177.   HTMLout += config.USERTEXT_SHOW_PostedByPrompt.weak ();
  5178.   HTMLout += ASPFHTML.SPAN_close ();
  5179.   HTMLout += ASPFHTML.TD_close ();
  5180.  
  5181.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  5182.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedBy);
  5183.   HTMLout += (this.authorName + " (" + ASPFHTML.QUOTE_open () + email.getFromEmailLink() + ASPFHTML.QUOTE_close () + ")").strong ();
  5184.   HTMLout += ASPFHTML.SPAN_close ();
  5185.   HTMLout += ASPFHTML.TD_close ();
  5186.   HTMLout += ASPFHTML.TR_close ();
  5187.  
  5188.   HTMLout += ASPFHTML.TR_open ();
  5189.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableTitleColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  5190.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedOnLabel);
  5191.   HTMLout += config.USERTEXT_SHOW_PostedOnPrompt.weak ();
  5192.   HTMLout += ASPFHTML.SPAN_close ();
  5193.   HTMLout += ASPFHTML.TD_close ();
  5194.  
  5195.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_TableFieldColumnWidth, undefined_disc, undefined_disc, undefined_disc, "bottom");
  5196.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgPostedOn);
  5197.   HTMLout += this.getDateCreated ().getLongFormat ().strong ();
  5198.   HTMLout += ASPFHTML.SPAN_close ();
  5199.   HTMLout += ASPFHTML.TD_close ();
  5200.   HTMLout += ASPFHTML.TR_close ();
  5201.  
  5202.   HTMLout += ASPFHTML.TR_open ();
  5203.   HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2);
  5204.   HTMLout += ASPFHTML.NBSP ();
  5205.   HTMLout += ASPFHTML.TD_close ();
  5206.   HTMLout += ASPFHTML.TR_close ();
  5207.  
  5208.   HTMLout += ASPFHTML.TR_open ();
  5209.   HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, 2);
  5210.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgBodyLabel);
  5211.   HTMLout += (config.USERTEXT_SHOW_BodyPrompt + ASPFHTML.BR ()).strong ();
  5212.   HTMLout += ASPFHTML.SPAN_close ();
  5213.   HTMLout += ASPFHTML.SPAN_open (config.ADMINSETTING_CSSClassMsgBody);
  5214.   HTMLout += this.body.messageBody ();
  5215.   HTMLout += ASPFHTML.SPAN_close ();
  5216.   HTMLout += ASPFHTML.TD_close ();
  5217.   HTMLout += ASPFHTML.TR_close ();
  5218.  
  5219.   HTMLout += ASPFHTML.TABLE_close ();
  5220.  
  5221.   delete email;
  5222.   return HTMLout;
  5223. }
  5224.  
  5225. ASPFMessage.prototype.getSubject = getSubject_msg_disc;
  5226. ASPFMessage.prototype.setSubject = setSubject_msg_disc;
  5227. ASPFMessage.prototype.getBody = getBody_msg_disc;
  5228. ASPFMessage.prototype.setBody = setBody_msg_disc;
  5229. ASPFMessage.prototype.getSortCode = getSortCode_msg_disc;
  5230. ASPFMessage.prototype.setSortCode = setSortCode_msg_disc;
  5231. ASPFMessage.prototype.getAuthorName = getAuthorName_msg_disc;
  5232. ASPFMessage.prototype.setAuthorName = setAuthorName_msg_disc;
  5233. ASPFMessage.prototype.getAuthorEmail = getAuthorEmail_msg_disc;
  5234. ASPFMessage.prototype.setAuthorEmail = setAuthorEmail_msg_disc;
  5235. ASPFMessage.prototype.getAuthorFullname = getAuthorFullname_msg_disc;
  5236. ASPFMessage.prototype.setAuthorFullname = setAuthorFullname_msg_disc;
  5237. ASPFMessage.prototype.getMessageID = getMessageID_msg_disc;
  5238. ASPFMessage.prototype.setMessageID = setMessageID_msg_disc;
  5239. ASPFMessage.prototype.getParentID = getParentID_msg_disc;
  5240. ASPFMessage.prototype.setParentID = setParentID_msg_disc;
  5241. ASPFMessage.prototype.getThreadID = getThreadID_msg_disc;
  5242. ASPFMessage.prototype.setThreadID = setThreadID_msg_disc;
  5243. ASPFMessage.prototype.getNumChildren = getNumChildren_msg_disc;
  5244. ASPFMessage.prototype.setNumChildren = setNumChildren_msg_disc;
  5245. ASPFMessage.prototype.getDateCreated = getDateCreated_msg_disc;
  5246. ASPFMessage.prototype.setDateCreated = setDateCreated_msg_disc;
  5247. ASPFMessage.prototype.getDateModified = getDateModified_msg_disc;
  5248. ASPFMessage.prototype.setDateModified = setDateModified_msg_disc;
  5249. ASPFMessage.prototype.getEmailParentOnResponse = getEmailParentOnResponse_msg_disc;
  5250. ASPFMessage.prototype.setEmailParentOnResponse = setEmailParentOnResponse_msg_disc;
  5251.  
  5252. ASPFMessage.prototype.getSummary = getSummary_msg_disc;
  5253. ASPFMessage.prototype.getSubjectLink = getSubjectLink_msg_disc;
  5254. ASPFMessage.prototype.getViewEntry = getViewEntry_msg_disc;
  5255. ASPFMessage.prototype.setAllFieldsEmpty = setAllFieldsEmpty_msg_disc;
  5256. ASPFMessage.prototype.setAllFieldsFromForm = setAllFieldsFromForm_msg_disc;
  5257. ASPFMessage.prototype.setAllFieldsFromMessage = setAllFieldsFromMessage_msg_disc;
  5258. ASPFMessage.prototype.setAllFieldsFromRecordSet = setAllFieldsFromRecordSet_msg_disc;
  5259. ASPFMessage.prototype.setAllFields = setAllFields_msg_disc;
  5260. ASPFMessage.prototype.getExpandCollapse = getExpandCollapse_msg_disc;
  5261. ASPFMessage.prototype.getDHTMLExpandCollapse = getDHTMLExpandCollapse_msg_disc;
  5262. ASPFMessage.prototype.sendAdminAlert = sendAdminAlert_msg_disc;
  5263. ASPFMessage.prototype.sendUserAlert = sendUserAlert_msg_disc;
  5264. ASPFMessage.prototype.saveAsNewMessage = saveAsNewMessage_msg_disc;
  5265. ASPFMessage.prototype.saveAsUpdatedMessage = saveAsUpdatedMessage_msg_disc;
  5266. ASPFMessage.prototype.saveUpdatedData = saveUpdatedData_msg_disc;
  5267. ASPFMessage.prototype.normalisePost = normalisePost_msg_disc;
  5268. ASPFMessage.prototype.validatePost = validatePost_msg_disc;
  5269. ASPFMessage.prototype.getRenderedHTML = getRenderedHTML_msg_disc;
  5270. </SCRIPT>
  5271.  
  5272. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  5273. //=======================================================================
  5274. //
  5275. // "ASP Forums" - a web-based discussion forum implementation.
  5276. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  5277. //
  5278. // This library is free software; you can redistribute it and/or
  5279. // modify it under the terms of the GNU Lesser General Public
  5280. // License as published by the Free Software Foundation; either
  5281. // version 2.1 of the License, or (at your option) any later version.
  5282. //
  5283. // This library is distributed in the hope that it will be useful,
  5284. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  5285. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  5286. // Lesserhttp://localhost:800/ASPForums/dev/ General Public License for more details.
  5287. //
  5288. // You should have received a copy of the GNU Lesser General Public
  5289. // License along with this library; if not, write to the Free Software
  5290. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  5291. //
  5292. //=======================================================================
  5293.  
  5294. //=======================================================================
  5295. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  5296. //=======================================================================
  5297.  
  5298. // ======================================================================
  5299. //
  5300. // PAGE OBJECT
  5301. //
  5302. // ======================================================================
  5303.  
  5304. function ASPFPageElement ()
  5305. {
  5306.   return this;
  5307. }
  5308.  
  5309. function showVersion_page_disc ()
  5310. {
  5311.   if (!ASPFPageElement.versionRefOutput)
  5312.     {
  5313.       var versionRef = "\n<" + "!-- GENERATED BY: " + config.SYS_CurrentVersionReference + " -->\n";
  5314.       versionRef.show ();
  5315.       ASPFPageElement.versionRefOutput = true;
  5316.     }
  5317.  
  5318.   return;
  5319. }
  5320.  
  5321. function setCurrentMessage_page_disc ()
  5322. {
  5323.   if (isUndefined_disc (currentMessage_disc))
  5324.     {
  5325.       if (!isNaN (Request.QueryString (config.FORM_QueryStringMessageID)))
  5326.     {
  5327.       var dBase = new ASPFDatabase ();
  5328.       currentMessage_disc = dBase.getMessageByID (Request.QueryString (config.FORM_QueryStringMessageID));
  5329.       delete dBase;
  5330.     }
  5331.     }
  5332.  
  5333.   return;
  5334. }
  5335.  
  5336. function showStandardMessage_page_disc ()
  5337. {
  5338.   this.showVersion ();
  5339.   this.setCurrentMessage ();
  5340.  
  5341.   this.showCurrentMessage ();
  5342.  
  5343.   this.showForumLink ();
  5344.  
  5345.   var table = ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize) + ASPFHTML.TR_open () + ASPFHTML.TD_open ();
  5346.   table.show ();
  5347.  
  5348.   this.showNewReplyButton ();
  5349.  
  5350.   table = ASPFHTML.TD_close () + ASPFHTML.TD_open ();
  5351.   table.show ();
  5352.  
  5353.   if (config.ADMINSWITCH_ShowNewPostButtonOnMessage == true)
  5354.     {
  5355.       this.showNewPostButton ();
  5356.     }
  5357.  
  5358.   table = ASPFHTML.TD_close () + ASPFHTML.TD_open ();
  5359.   table.show ();
  5360.  
  5361.   this.showEditPostButton ();
  5362.  
  5363.   table = ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TABLE_close ();
  5364.   table.show ();
  5365. }
  5366.  
  5367. function showForumLink_page_disc ()
  5368. {
  5369.   this.showVersion ();
  5370.  
  5371.   var HTMLout = ASPFHTML.P_open () + this.getForumLink (config.USERTEXT_POST_ForumLinkPrefix + config.ADMINSETTING_ForumName).weak () + ASPFHTML.P_close ();
  5372.   HTMLout.show ();
  5373.  
  5374.   return;
  5375. }
  5376.  
  5377. function showForumTitle_page_disc ()
  5378. {
  5379.   config.ADMINSETTING_ForumName.show ();
  5380.   return;
  5381. }
  5382.  
  5383. function showMessageSubject_page_disc ()
  5384. {
  5385.   this.showVersion ();
  5386.   this.setCurrentMessage ();
  5387.  
  5388.   if (isDefined_disc (currentMessage_disc))
  5389.     {
  5390.       currentMessage_disc.subject.show ();
  5391.     }
  5392.  
  5393.   return;
  5394. }
  5395.  
  5396. function showMessageBody_page_disc ()
  5397. {
  5398.   this.showVersion ();
  5399.   this.setCurrentMessage ();
  5400.  
  5401.   if (isDefined_disc (currentMessage_disc))
  5402.     {
  5403.       currentMessage_disc.body.show ();
  5404.     }
  5405.  
  5406.   return;
  5407. }
  5408.  
  5409. function showMessageAuthorName_page_disc ()
  5410. {
  5411.   this.showVersion ();
  5412.   this.setCurrentMessage ();
  5413.  
  5414.   if (isDefined_disc (currentMessage_disc))
  5415.     {
  5416.       currentMessage_disc.authorName.show ();
  5417.     }
  5418.  
  5419.   return;
  5420. }
  5421.  
  5422. function showMessageAuthorEmail_page_disc ()
  5423. {
  5424.   this.showVersion ();
  5425.   this.setCurrentMessage ();
  5426.  
  5427.   if (isDefined_disc (currentMessage_disc))
  5428.     {
  5429.       currentMessage_disc.authorEmail.show ();
  5430.     }
  5431.  
  5432.   return;
  5433. }
  5434.  
  5435. function showMessageAuthorFullname_page_disc ()
  5436. {
  5437.   this.showVersion ();
  5438.   this.setCurrentMessage ();
  5439.  
  5440.   if (isDefined_disc (currentMessage_disc))
  5441.     {
  5442.       currentMessage_disc.authorFullname.show ();
  5443.     }
  5444.  
  5445.   return;
  5446. }
  5447.  
  5448. function showMessageDateCreated_page_disc ()
  5449. {
  5450.   this.showVersion ();
  5451.   this.setCurrentMessage ();
  5452.  
  5453.   if (isDefined_disc (currentMessage_disc))
  5454.     {
  5455.       currentMessage_disc.dateCreated.show ();
  5456.     }
  5457.  
  5458.   return;
  5459. }
  5460.  
  5461. function showMessageDateModified_page_disc ()
  5462. {
  5463.   this.showVersion ();
  5464.   this.setCurrentMessage ();
  5465.  
  5466.   if (isDefined_disc (currentMessage_disc))
  5467.     {
  5468.       currentMessage_disc.dateModified.show ();
  5469.     }
  5470.  
  5471.   return;
  5472. }
  5473.  
  5474. function showMessageSortCode_page_disc ()
  5475. {
  5476.   this.showVersion ();
  5477.   this.setCurrentMessage ();
  5478.  
  5479.   if (isDefined_disc (currentMessage_disc))
  5480.     {
  5481.       currentMessage_disc.sortCode.show ();
  5482.     }
  5483.  
  5484.   return;
  5485. }
  5486.  
  5487. function showMessageNumChildren_page_disc ()
  5488. {
  5489.   this.showVersion ();
  5490.   this.setCurrentMessage ();
  5491.  
  5492.   if (isDefined_disc (currentMessage_disc))
  5493.     {
  5494.       String (currentMessage_disc.numChildren).show ();
  5495.     }
  5496.  
  5497.   return;
  5498. }
  5499.  
  5500. function showMessageID_page_disc ()
  5501. {
  5502.   this.showVersion ();
  5503.   this.setCurrentMessage ();
  5504.  
  5505.   if (isDefined_disc (currentMessage_disc))
  5506.     {
  5507.       String (currentMessage_disc.messageID).show ();
  5508.     }
  5509.  
  5510.   return;
  5511. }
  5512.  
  5513. function showMessageParentID_page_disc ()
  5514. {
  5515.   this.showVersion ();
  5516.   this.setCurrentMessage ();
  5517.  
  5518.   if (isDefined_disc (currentMessage_disc))
  5519.     {
  5520.       String (currentMessage_disc.parentID).show ();
  5521.     }
  5522.  
  5523.   return;
  5524. }
  5525.  
  5526. function showMessageThreadID_page_disc ()
  5527. {
  5528.   this.showVersion ();
  5529.   this.setCurrentMessage ();
  5530.  
  5531.   if (isDefined_disc (currentMessage_disc))
  5532.     {
  5533.       String (currentMessage_disc.threadID).show ();
  5534.     }
  5535.  
  5536.   return;
  5537. }
  5538.  
  5539. function showParentMessageLink_page_disc ()
  5540. {
  5541.   this.showVersion ();
  5542.  
  5543.   var link = this.getParentMessageLink (config.USERTEXT_POST_PreviousMessageLinkText);
  5544.   link.show ();
  5545.  
  5546.   return;
  5547. }
  5548.  
  5549. function showSearchForm_page_disc ()
  5550. {
  5551.   this.showVersion ();
  5552.  
  5553.   var HTMLout;
  5554.   var searchForm = new ASPFForm (Request.Form);
  5555.   HTMLout = searchForm.getSearchForm (config.USERTEXT_SEARCH_SubmitButton);
  5556.   HTMLout.show ();
  5557.  
  5558.   delete searchForm;
  5559.   return;
  5560. }
  5561.  
  5562. function showSmallSearchForm_page_disc ()
  5563. {
  5564.   this.showVersion ();
  5565.  
  5566.   var HTMLout;
  5567.   var searchForm = new ASPFForm (Request.Form);
  5568.   HTMLout = searchForm.getSmallSearchForm (config.USERTEXT_SEARCH_SubmitButton);
  5569.   HTMLout.show ();
  5570.  
  5571.   delete searchForm;
  5572.   return;
  5573. }
  5574.  
  5575. function showNewPostButton_page_disc ()
  5576. {
  5577.   this.showVersion ();
  5578.  
  5579.   var postButton = ASPFHTML.FORM_open (config.getNewPostPagePath ());
  5580.   postButton += ASPFHTML.INPUT_submit (config.USERTEXT_SHOW_NewPostButton, config.USERTEXT_SHOW_NewPostButton);
  5581.   postButton += ASPFHTML.FORM_close ();
  5582.  
  5583.   postButton.show ();
  5584.  
  5585.   return;
  5586. }
  5587.  
  5588. function showNewPostLink_page_disc ()
  5589. {
  5590.   this.showVersion ();
  5591.  
  5592.   var link = ASPFHTML.A_open (config.getNewPostPagePath ()) + config.USERTEXT_SHOW_NewPostButton + ASPFHTML.A_close ();
  5593.   link.show ();
  5594.  
  5595.   return;
  5596. }
  5597.  
  5598. function showCurrentMessage_page_disc ()
  5599. {
  5600.   this.showVersion ();
  5601.   this.setCurrentMessage ();
  5602.  
  5603.   if (isDefined_disc (currentMessage_disc))
  5604.     {
  5605.       var messageHTML = currentMessage_disc.getRenderedHTML ();
  5606.       messageHTML.show ();
  5607.     }
  5608.  
  5609.   return;
  5610. }
  5611.  
  5612. function showNewReplyButton_page_disc ()
  5613. {
  5614.   this.showVersion ();
  5615.   this.setCurrentMessage ();
  5616.  
  5617.   var HTMLout = this.getNewReplyButton ();
  5618.   HTMLout.show ();
  5619.  
  5620.   return;
  5621. }
  5622.  
  5623. function showEditPostButton_page_disc ()
  5624. {
  5625.   this.showVersion ();
  5626.   this.setCurrentMessage ();
  5627.  
  5628.   if (((currentMessage_disc.authorName == currentUsername_disc) && (config.ADMINSWITCH_AllowUserEditing == true)) || isAdministrator_disc)
  5629.     {
  5630.       var editButton = ASPFHTML.FORM_open (config.getEditPostPagePath ());
  5631.       editButton += ASPFHTML.INPUT_hidden (config.FORM_FieldMessageID, currentMessage_disc.messageID);
  5632.       editButton += ASPFHTML.INPUT_submit (config.USERTEXT_SHOW_EditPostButton, config.USERTEXT_SHOW_EditPostButton);
  5633.       editButton += ASPFHTML.FORM_close ();
  5634.  
  5635.       editButton.show ();
  5636.     }
  5637.  
  5638.   return;
  5639. }
  5640.  
  5641. function showAllThreads_page_disc ()
  5642. {
  5643.   this.showVersion ();
  5644.   this.setCurrentMessage ();
  5645.  
  5646.   var currentThread = new ASPFThread (0);
  5647.   var HTMLout = currentThread.getAllSorted (config.ADMINSWITCH_ViewPostsAscending);
  5648.   HTMLout.show ();
  5649.  
  5650.   delete currentThread;
  5651.   return;
  5652. }
  5653.  
  5654. function showCurrentThreadsStatic_page_disc ()
  5655. {
  5656.   this.showVersion ();
  5657.   this.setCurrentMessage ();
  5658.  
  5659.   var currentMessageID = isUndefined_disc (currentMessage_disc) ? 0 : currentMessage_disc.messageID;
  5660.  
  5661.   var currentThread = new ASPFThread (currentMessageID);
  5662.   var HTMLout = currentThread.getCurrentSorted (config.ADMINSWITCH_ViewPostsAscending);
  5663.   HTMLout.show ();
  5664.  
  5665.   delete currentThread;
  5666.   return;
  5667. }
  5668.  
  5669. function showCurrentThreads_page_disc ()
  5670. {
  5671.   this.showVersion ();
  5672.   this.setCurrentMessage ();
  5673.  
  5674.   var expandTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewExpand))) ? false : true;
  5675.   var collapseTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewCollapse))) ? false : true;
  5676.   var currentMessageID = isUndefined_disc (currentMessage_disc) ? 0 : currentMessage_disc.messageID;
  5677.  
  5678.   var currentThread = new ASPFThread (currentMessageID);
  5679.   var HTMLout;
  5680.   if ((expandTokensPresent) || (collapseTokensPresent))
  5681.     {
  5682.       HTMLout = currentThread.getCurrentSorted (config.ADMINSWITCH_ViewPostsAscending);
  5683.     }
  5684.   else
  5685.     {
  5686.       HTMLout = currentThread.getCurrentSortedDHTML (config.ADMINSWITCH_ViewPostsAscending);
  5687.     }
  5688.   HTMLout.show ();
  5689.  
  5690.   delete currentThread;
  5691.   return;
  5692. }
  5693.  
  5694. function showNewPostForm_page_disc ()
  5695. {
  5696.   this.showVersion ();
  5697.  
  5698.   var newMessageForm = new ASPFForm (Request.Form);
  5699.   var subject = newMessageForm.getSubject ().unformatFromStoring ();
  5700.  
  5701.   if ((subject != "") && (newMessageForm.getThreadID () != "") && (subject.substring(0, config.USERTEXT_POST_ReplySubjectPrefix.length) != config.USERTEXT_POST_ReplySubjectPrefix))
  5702.     {
  5703.       newMessageForm.setSubject (config.USERTEXT_POST_ReplySubjectPrefix + subject);
  5704.     }
  5705.   else
  5706.     {
  5707.       newMessageForm.setSubject (subject);
  5708.     }
  5709.  
  5710.   var HTMLout = newMessageForm.getMessageForm (config.getNewPostActionPagePath (), config.USERTEXT_POST_SubmitButton);
  5711.   HTMLout.show ();
  5712.  
  5713.   delete newMessageForm;
  5714.   return;
  5715. }
  5716.  
  5717. function showEditPostForm_page_disc ()
  5718. {
  5719.   this.showVersion ();
  5720.  
  5721.   var newMessageForm = new ASPFForm (Request.Form);
  5722.   var dbase = new ASPFDatabase ();
  5723.   var newMessage = dbase.getMessageByID (newMessageForm.getMessageID ());
  5724.   newMessageForm.setAllFields (newMessage);
  5725.  
  5726.   var HTMLout;
  5727.   if ((newMessageForm.getAuthorName () == currentUsername_disc) || isAdministrator_disc)
  5728.     {
  5729.       HTMLout = newMessageForm.getMessageForm (config.getEditPostActionPagePath (), config.USERTEXT_POST_SaveChangesButton);
  5730.     }
  5731.   else
  5732.     {
  5733.       HTMLout = config.USERTEXT_POST_NotAuthorisedToEditMessage.weak();
  5734.     }
  5735.   HTMLout.show ();
  5736.  
  5737.   delete newMessageForm;
  5738.   delete dbase;
  5739.   delete newMessage;
  5740.   return;
  5741. }
  5742.  
  5743. function showCurrentThread_page_disc ()
  5744. {
  5745.   this.showVersion ();
  5746.   this.setCurrentMessage ();
  5747.  
  5748.   if (isDefined_disc (currentMessage_disc))
  5749.     {
  5750.       var expandedThread = new ASPFThread (currentMessage_disc.messageID);
  5751.       var HTMLout = expandedThread.getFullThread (currentMessage_disc.threadID);
  5752.       HTMLout.show ();
  5753.       delete expandedThread;
  5754.     }
  5755.  
  5756.   return;
  5757. }
  5758.  
  5759. function showArchive_page_disc ()
  5760. {
  5761.   this.showVersion ();
  5762.  
  5763.   this.showArchiveSelector ();
  5764.   this.actionShowArchive ();
  5765.  
  5766.   return;
  5767. }
  5768.  
  5769. function showArchiveSelector_page_disc ()
  5770. {
  5771.   var archiveForm = new ASPFForm (Request.QueryString);
  5772.   var HTMLout = archiveForm.getArchiveSelector ();
  5773.   HTMLout.show ();
  5774.  
  5775.   return;
  5776. }
  5777.  
  5778. function showAdminSQLForm_page_disc ()
  5779. {
  5780.   this.showVersion ();
  5781.  
  5782.   var HTMLout = ASPFHTML.P_open () + config.USERTEXT_SQL_EnterPrompt + ASPFHTML.P_close ();
  5783.  
  5784.   var adminForm = new ASPFForm (Request.Form);
  5785.   HTMLout += adminForm.getAdminForm ();
  5786.   HTMLout.show ();
  5787.  
  5788.   delete adminForm;
  5789.   return;
  5790. }
  5791.  
  5792. function actionSaveNewMessage_page_disc ()
  5793. {
  5794.   var newMessageForm = new ASPFForm (Request.Form);
  5795.   var newMessage = new ASPFMessage ();
  5796.   newMessage.setAllFields (newMessageForm);
  5797.  
  5798.   if (!newMessage.saveAsNewMessage (config.USERTEXT_POST_PostSuccessful, config.USERTEXT_POST_PostFailedPrefix))
  5799.     {
  5800.       var invalidMessageForm = new ASPFForm (Request.Form);
  5801.       invalidMessageForm.setAllFields (newMessage);
  5802.       var HTMLout = invalidMessageForm.getMessageForm (config.getNewPostActionPagePath (), config.USERTEXT_POST_SubmitButton);
  5803.       HTMLout.show ();
  5804.       delete invalidMessageForm;
  5805.     }
  5806.  
  5807.   currentMessage_disc = newMessage;
  5808.  
  5809.   delete newMessageForm;
  5810.   return;
  5811. }
  5812.  
  5813. function actionSaveUpdatedMessage_page_disc ()
  5814. {
  5815.   var newMessageForm = new ASPFForm (Request.Form);
  5816.   var newMessage = new ASPFMessage ();
  5817.   newMessage.setAllFields (newMessageForm);
  5818.  
  5819.   if (!newMessage.saveAsUpdatedMessage (config.USERTEXT_POST_UpdateSuccessful, config.USERTEXT_POST_UpdateFailedPrefix))
  5820.     {
  5821.       var invalidMessageForm = new ASPFForm (Request.Form);
  5822.       invalidMessageForm.setAllFields (newMessage);
  5823.       var HTMLout = invalidMessageForm.getMessageForm (config.getEditPostActionPagePath (), config.USERTEXT_POST_SaveChangesButton);
  5824.       HTMLout.show ();
  5825.       delete invalidMessageForm;
  5826.     }
  5827.  
  5828.   currentMessage_disc = newMessage;
  5829.  
  5830.   delete newMessageForm;
  5831.   return;
  5832. }
  5833.  
  5834. function actionSearch_page_disc ()
  5835. {
  5836.   var searchForm = new ASPFForm (Request.Form);
  5837.   var searchString = searchForm.getSearchString ();
  5838.  
  5839.   if ("" != searchString)
  5840.     {
  5841.       var HTMLout = "";
  5842.       var dBase = new ASPFDatabase ();
  5843.       var foundMessages = dBase.searchForum (searchString);
  5844.  
  5845.       HTMLout += config.USERTEXT_SEARCH_ResultsHeader1 + (ASPFHTML.QUOTE_open () + searchString + ASPFHTML.QUOTE_close ()).strong();
  5846.       HTMLout += config.USERTEXT_SEARCH_ResultsHeader2 + String (foundMessages.RecordCount).strong();
  5847.       if (foundMessages.RecordCount == 0)
  5848.     {
  5849.       HTMLout += config.USERTEXT_SEARCH_ResultsHeaderSuffix0Match + ASPFHTML.BR ();
  5850.     }
  5851.       else
  5852.     {
  5853.       if (foundMessages.RecordCount == 1)
  5854.         {
  5855.           HTMLout += config.USERTEXT_SEARCH_ResultsHeaderSuffix1Match + ASPFHTML.BR ();
  5856.         }
  5857.       else
  5858.         {
  5859.           HTMLout += config.USERTEXT_SEARCH_ResultsHeaderSuffixManyMatches + ASPFHTML.BR ();
  5860.         }
  5861.     }
  5862.  
  5863.       if (!foundMessages.EOF)
  5864.     {
  5865.       var currentMessage;
  5866.  
  5867.       foundMessages.MoveFirst ();
  5868.       HTMLout += ASPFHTML.OL_open ();
  5869.  
  5870.       while (!foundMessages.EOF)
  5871.         {
  5872.           currentMessage = new ASPFMessage (foundMessages);
  5873.  
  5874.           HTMLout += currentMessage.getSummary ();
  5875.  
  5876.           foundMessages.MoveNext ();
  5877.  
  5878.           delete currentMessage;
  5879.         }
  5880.       HTMLout += ASPFHTML.OL_close ();
  5881.     }
  5882.  
  5883.       HTMLout.show();
  5884.       foundMessages.Close ();
  5885.  
  5886.       delete foundMessages;
  5887.       delete dBase;
  5888.     }
  5889.  
  5890.   delete searchForm;
  5891.   return;
  5892. }
  5893.  
  5894. function actionExecuteAdminSQL_page_disc ()
  5895. {
  5896.   var HTMLout = "";
  5897.   var SQLForm = new ASPFForm (Request.Form);
  5898.   var SQLString = String (SQLForm.getSQLStatement ());
  5899.  
  5900.   if (SQLString != "")
  5901.     {
  5902.       var dbase = new ASPFDatabase ();
  5903.       var connection = dbase.getOpenDatabaseConnection ();
  5904.       var returnedRecords;
  5905.  
  5906.       returnedRecords = dbase.getAdminSQLResults (connection, SQLString);
  5907.       HTMLout += ASPFHTML.TABLE_open (config.ADMINSETTING_TableBorderSize, "100%", "#FFFFFF") + ASPFHTML.TR_open () + ASPFHTML.TD_open ();
  5908.       HTMLout += (config.USERTEXT_SQL_ResultsPrefix + ASPFHTML.prototype.BR ()).strong();
  5909.       HTMLout += config.USERTEXT_SQL_StatementPrefix.weak() + String (SQLString).strongSmall() + ASPFHTML.prototype.BR ();
  5910.  
  5911.       HTMLout += ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TR_open () + ASPFHTML.TD_open ();
  5912.  
  5913.       HTMLout += this.formatAdminSQLResults (SQLString, returnedRecords);
  5914.  
  5915.       HTMLout += dbase.getConnectionErrors (connection).formatForStoring ();
  5916.  
  5917.       //returnedRecords.close ();
  5918.  
  5919.       HTMLout += ASPFHTML.TD_close () + ASPFHTML.TR_close () + ASPFHTML.TABLE_close ();
  5920.  
  5921.       delete dbase;
  5922.       delete returnedRecords;
  5923.     }
  5924.  
  5925.   var messageIDToDelete = String (SQLForm.messageIDToDelete);
  5926.   if (messageIDToDelete != "")
  5927.     {
  5928.       if (0 != Number (messageIDToDelete))
  5929.     {
  5930.       var deleteDBase = new ASPFDatabase ();
  5931.       deleteDBase.deleteMessageHierarchy (messageIDToDelete).show ();
  5932.       delete deleteDBase;
  5933.     }
  5934.     }
  5935.  
  5936.   var purgeCache = SQLForm.purgeCache;
  5937.   if (purgeCache)
  5938.     {
  5939.       var cache = new ASPFCache ();
  5940.       cache.purge ();
  5941.       delete cache;
  5942.     }
  5943.  
  5944.   HTMLout.show ();
  5945.  
  5946.   delete SQLForm;
  5947.   return;
  5948. }
  5949.  
  5950. function actionShowArchive_page_disc ()
  5951. {
  5952.   var archiveForm = new ASPFForm (Request.QueryString);
  5953.   var archiveDate = archiveForm.getArchiveDate ();
  5954.  
  5955.   if (isDefined_disc (archiveDate))
  5956.     {
  5957.       var expandTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewExpand))) ? false : true;
  5958.       var collapseTokensPresent = isUndefined_disc (String (Request.QueryString (config.FORM_QueryStringViewCollapse))) ? false : true;
  5959.  
  5960.       var currentThread = new ASPFThread ();
  5961.       var HTMLout;
  5962.       if ((expandTokensPresent) || (collapseTokensPresent))
  5963.     {
  5964.       HTMLout = currentThread.getArchiveSorted (archiveDate, config.ADMINSWITCH_ViewPostsAscending);
  5965.     }
  5966.       else
  5967.     {
  5968.       HTMLout = currentThread.getArchiveSortedDHTML (archiveDate, config.ADMINSWITCH_ViewPostsAscending);
  5969.     }
  5970.       HTMLout.show ();
  5971.  
  5972.       delete currentThread;
  5973.     }
  5974.  
  5975.   return;
  5976. }
  5977.  
  5978. // -
  5979. // Private 'get' routines
  5980. //
  5981.  
  5982. function getForumLink_page_disc (textToUse)
  5983. {
  5984.   return ASPFHTML.A_open (config.getMainPagePreferredPath (), config.ADMINSETTING_ForumName) + textToUse + ASPFHTML.A_close ();
  5985. }
  5986.  
  5987. function getParentMessageLink_page_disc (textToUse)
  5988. {
  5989.   var HTMLout = "";
  5990.   var messageForm = new ASPFForm (Request.Form);
  5991.   var parentID = messageForm.getParentID ();
  5992.   if (parentID != 0)
  5993.     {
  5994.       HTMLout = ASPFHTML.P_open ();
  5995.       HTMLout += ASPFHTML.A_open (config.getShowMessagePagePath () + "?" + config.FORM_QueryStringMessageID + "=" + parentID, textToUse);
  5996.       HTMLout += textToUse.weak ();
  5997.       HTMLout += ASPFHTML.A_close ();
  5998.       HTMLout += ASPFHTML.P_close ();
  5999.     }
  6000.  
  6001.   delete messageForm;
  6002.   return HTMLout;
  6003. }
  6004.  
  6005. function formatAdminSQLResults_page_disc (SQLString, recordSet)
  6006. {
  6007.   var HTMLout = "";
  6008.  
  6009.   if (String (SQLString).search(/select/gi) > -1)
  6010.     {
  6011.       HTMLout += ASPFHTML.TABLE_open (2, undefined_disc, "#FFFFFF") + ASPFHTML.TR_open ();
  6012.  
  6013.       var counter;
  6014.       var numRecordFields = recordSet.fields.count - 1;
  6015.       for (counter = 0; counter < numRecordFields; counter++)
  6016.     {
  6017.       HTMLout += ASPFHTML.TH_open (undefined_disc, "left", undefined_disc, true);
  6018.       HTMLout += String (recordSet(counter).name).strong();
  6019.       HTMLout += ASPFHTML.TH_close ();
  6020.     }
  6021.       HTMLout += ASPFHTML.TR_close ();
  6022.  
  6023.       while (!recordSet.EOF)
  6024.     {
  6025.       HTMLout += ASPFHTML.TR_open ();
  6026.  
  6027.       for (counter = 0; counter < numRecordFields; counter++)
  6028.         {
  6029.           HTMLout += ASPFHTML.TD_open (undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, true);
  6030.           HTMLout += recordSet.fields(counter).value;
  6031.           HTMLout += ASPFHTML.TD_close ();
  6032.         }
  6033.  
  6034.       HTMLout += ASPFHTML.TR_close ();
  6035.       recordSet.movenext ();
  6036.     }
  6037.  
  6038.       HTMLout += ASPFHTML.TABLE_close ();
  6039.     }
  6040.  
  6041.   return HTMLout;
  6042. }
  6043.  
  6044. function getNewReplyButton_page_disc ()
  6045. {
  6046.   this.setCurrentMessage ();
  6047.  
  6048.   return this.getNewReplyButtonWithTextAndMessage (config.USERTEXT_SHOW_ReplyPostButton, currentMessage_disc);
  6049. }
  6050.  
  6051. function getNewReplyButtonWithTextAndMessage_page_disc (buttonText, message)
  6052. {
  6053.   this.setCurrentMessage ();
  6054.  
  6055.   var HTMLout = "";
  6056.  
  6057.   if (isDefined_disc (message))
  6058.     {
  6059.       HTMLout = ASPFHTML.FORM_open (config.getNewPostPagePath ());
  6060.       HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldParentID, message.messageID);
  6061.       HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldThreadID, message.threadID);
  6062.       HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldSortCode, message.sortCode);
  6063.       HTMLout += ASPFHTML.INPUT_hidden (config.FORM_FieldSubject, message.subject);
  6064.       HTMLout += ASPFHTML.INPUT_submit (buttonText, buttonText);
  6065.       HTMLout += ASPFHTML.FORM_close ();
  6066.     }
  6067.  
  6068.   return HTMLout;
  6069. }
  6070.  
  6071. ASPFPageElement.versionRefOutput = false;
  6072.  
  6073. ASPFPageElement.showVersion = showVersion_page_disc;
  6074. ASPFPageElement.setCurrentMessage = setCurrentMessage_page_disc;
  6075. ASPFPageElement.showStandardMessage = showStandardMessage_page_disc;
  6076. ASPFPageElement.showForumLink = showForumLink_page_disc;
  6077. ASPFPageElement.showForumTitle = showForumTitle_page_disc;
  6078.  
  6079. ASPFPageElement.showMessageSubject = showMessageSubject_page_disc;
  6080. ASPFPageElement.showMessageBody = showMessageBody_page_disc;
  6081. ASPFPageElement.showMessageAuthorName = showMessageAuthorName_page_disc;
  6082. ASPFPageElement.showMessageAuthorEmail = showMessageAuthorEmail_page_disc;
  6083. ASPFPageElement.showMessageAuthorFullname = showMessageAuthorFullname_page_disc;
  6084. ASPFPageElement.showMessageDateCreated = showMessageDateCreated_page_disc;
  6085. ASPFPageElement.showMessageDateModified = showMessageDateModified_page_disc;
  6086. ASPFPageElement.showMessageSortCode = showMessageSortCode_page_disc;
  6087. ASPFPageElement.showMessageNumChildren = showMessageNumChildren_page_disc;
  6088. ASPFPageElement.showMessageID = showMessageID_page_disc;
  6089. ASPFPageElement.showMessageParentID = showMessageParentID_page_disc;
  6090. ASPFPageElement.showMessageThreadID = showMessageThreadID_page_disc;
  6091.  
  6092. ASPFPageElement.showParentMessageLink = showParentMessageLink_page_disc;
  6093. ASPFPageElement.showSearchForm = showSearchForm_page_disc;
  6094. ASPFPageElement.showSmallSearchForm = showSmallSearchForm_page_disc;
  6095. ASPFPageElement.showNewPostButton = showNewPostButton_page_disc;
  6096. ASPFPageElement.showNewPostLink = showNewPostLink_page_disc;
  6097. ASPFPageElement.showCurrentMessage = showCurrentMessage_page_disc;
  6098. ASPFPageElement.showNewReplyButton = showNewReplyButton_page_disc;
  6099. ASPFPageElement.showEditPostButton = showEditPostButton_page_disc;
  6100. ASPFPageElement.showAllThreads = showAllThreads_page_disc;
  6101. ASPFPageElement.showCurrentThreadsStatic = showCurrentThreadsStatic_page_disc;
  6102. ASPFPageElement.showCurrentThreads = showCurrentThreads_page_disc;
  6103. ASPFPageElement.showNewPostForm = showNewPostForm_page_disc;
  6104. ASPFPageElement.showEditPostForm = showEditPostForm_page_disc;
  6105. ASPFPageElement.showCurrentThread = showCurrentThread_page_disc;
  6106. ASPFPageElement.showArchive = showArchive_page_disc;
  6107. ASPFPageElement.showArchiveSelector = showArchiveSelector_page_disc;
  6108. ASPFPageElement.showAdminSQLForm = showAdminSQLForm_page_disc;
  6109.  
  6110. ASPFPageElement.actionSaveUpdatedMessage = actionSaveUpdatedMessage_page_disc;
  6111. ASPFPageElement.actionSaveNewMessage = actionSaveNewMessage_page_disc;
  6112. ASPFPageElement.actionSearch = actionSearch_page_disc;
  6113. ASPFPageElement.actionExecuteAdminSQL = actionExecuteAdminSQL_page_disc;
  6114. ASPFPageElement.actionShowArchive = actionShowArchive_page_disc;
  6115.  
  6116. ASPFPageElement.getForumLink = getForumLink_page_disc;
  6117. ASPFPageElement.getParentMessageLink = getParentMessageLink_page_disc;
  6118. ASPFPageElement.formatAdminSQLResults = formatAdminSQLResults_page_disc;
  6119. ASPFPageElement.getNewReplyButton = getNewReplyButton_page_disc;
  6120. ASPFPageElement.getNewReplyButtonWithTextAndMessage = getNewReplyButtonWithTextAndMessage_page_disc;
  6121. </SCRIPT>
  6122.  
  6123. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  6124. //=======================================================================
  6125. //
  6126. // "ASP Forums" - a web-based discussion forum implementation.
  6127. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  6128. //
  6129. // This library is free software; you can redistribute it and/or
  6130. // modify it under the terms of the GNU Lesser General Public
  6131. // License as published by the Free Software Foundation; either
  6132. // version 2.1 of the License, or (at your option) any later version.
  6133. //
  6134. // This library is distributed in the hope that it will be useful,
  6135. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  6136. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  6137. // Lesser General Public License for more details.
  6138. //
  6139. // You should have received a copy of the GNU Lesser General Public
  6140. // License along with this library; if not, write to the Free Software
  6141. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  6142. //
  6143. //=======================================================================
  6144.  
  6145. //=======================================================================
  6146. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  6147. //=======================================================================
  6148.  
  6149. // ======================================================================
  6150. //
  6151. // STRING OBJECT ADDITIONS
  6152. //
  6153. // ======================================================================
  6154.  
  6155. // ======================================================================
  6156. //
  6157. // Main object additions.
  6158. //
  6159. // ======================================================================
  6160.  
  6161. function strong_str_disc ()
  6162. {
  6163.   return ASPFHTML.FONT_open () + ASPFHTML.STRONG_open () + this + ASPFHTML.STRONG_close () + ASPFHTML.FONT_close ();
  6164. }
  6165.  
  6166. function strongBig_str_disc ()
  6167. {
  6168.   return ASPFHTML.FONT_open ("+1") + ASPFHTML.STRONG_open () + this + ASPFHTML.STRONG_close () + ASPFHTML.FONT_close ();
  6169. }
  6170.  
  6171. function strongSmall_str_disc ()
  6172. {
  6173.   return ASPFHTML.FONT_open ("-1") + ASPFHTML.STRONG_open () + this + ASPFHTML.STRONG_close () + ASPFHTML.FONT_close ();
  6174. }
  6175.  
  6176. function weak_str_disc ()
  6177. {
  6178.   return ASPFHTML.FONT_open () + this + ASPFHTML.FONT_close ();
  6179. }
  6180.  
  6181. function weakBig_str_disc ()
  6182. {
  6183.   return ASPFHTML.FONT_open ("+1") + this + ASPFHTML.FONT_close ();
  6184. }
  6185.  
  6186. function weakSmall_str_disc ()
  6187. {
  6188.   return ASPFHTML.FONT_open ("-1") + this + ASPFHTML.FONT_close ();
  6189. }
  6190.  
  6191. function messageBody_str_disc ()
  6192. {
  6193.   return ASPFHTML.BLOCKQUOTE_open () + this + ASPFHTML.BLOCKQUOTE_close ();
  6194. }
  6195.  
  6196. function paragraph_str_disc ()
  6197. {
  6198.   return ASPFHTML.P_open () + this + ASPFHTML.P_close ();
  6199. }
  6200.  
  6201. function show_str_disc ()
  6202. {
  6203.   Response.Write (this);
  6204. }
  6205.  
  6206. function formatForURL_str_disc ()
  6207. {
  6208.   var workingText;
  6209.  
  6210.   workingText = this;
  6211.   workingText = workingText.replace (/\ /gi, "%20");
  6212.   workingText = workingText.replace (/\\/gi, "/");
  6213.  
  6214.   return workingText;
  6215. }
  6216.  
  6217. function safeFormat_str_disc ()
  6218. {
  6219.   var workingText;
  6220.  
  6221.   workingText = this;
  6222.  
  6223.   workingText = Server.HTMLEncode (workingText);
  6224.   workingText = workingText.replace (/\'/gi, "’");
  6225.   workingText = workingText.replace (/\"/gi, """);
  6226.   workingText = workingText.replace (/\n/gi, " ");
  6227.   workingText = workingText.replace (/\r/gi, " ");
  6228.  
  6229.   return workingText;
  6230. }
  6231.  
  6232. function javascriptSafeFormat_str_disc ()
  6233. {
  6234.   var workingText;
  6235.  
  6236.   workingText = this;
  6237.  
  6238.   workingText = workingText.replace (/\"/gi, "\\\"");
  6239.   workingText = workingText.replace (/\n/gi, " ");
  6240.   workingText = workingText.replace (/\r/gi, " ");
  6241.  
  6242.   return workingText;
  6243. }
  6244.  
  6245. function HTMLiseLinefeeds_str_disc ()
  6246. {
  6247.   var workingText;
  6248.  
  6249.   workingText = this;
  6250.  
  6251.   workingText = workingText.replace (/\n\n/gi, "</P><P>");
  6252.   workingText = workingText.replace (/\n/gi, "<BR>");
  6253.   workingText = workingText.replace (/\r/gi, "");
  6254.  
  6255.   return workingText;
  6256. }
  6257.  
  6258. function purify_str_disc ()
  6259. {
  6260.   var workingText = this;
  6261.   workingText = workingText.replace (/motherfuck/gi, "**********");
  6262.   workingText = workingText.replace (/fuck/gi, "****");
  6263.   workingText = workingText.replace (/shit/gi, "****");
  6264.   workingText = workingText.replace (/cunt/gi, "****");
  6265.   workingText = workingText.replace (/bastard/gi, "*******");
  6266.  
  6267.   return workingText;
  6268. }
  6269.  
  6270. function formatForStoring_str_disc ()
  6271. {
  6272.   var workingText = this.purify();
  6273.  
  6274.   workingText = workingText.replace (/\n\n/gi, ASPFHTML.P_open () + ASPFHTML.P_close ());
  6275. //workingText = workingText.replace (/\n/gi, ASPFHTML.BR ());
  6276.   workingText = workingText.removeMaliciousTags ();
  6277.   workingText = workingText.convertComplexTags ();
  6278.   workingText = workingText.fixBrokenTags ();
  6279.  
  6280.   if (!config.ADMINSWITCH_AllowRichFormatting)
  6281.     {
  6282.       workingText = workingText.stripAllTags ();
  6283.     }
  6284.  
  6285.   return workingText;
  6286. }
  6287.  
  6288. function unformatFromStoring_str_disc ()
  6289. {
  6290.   var workingText;
  6291.  
  6292.   workingText = this;
  6293.  
  6294.   workingText = workingText.replace (/\<P[^\>]*\>/gi, "\n");
  6295.   workingText = workingText.replace (/\<\/P[^\>]\>/gi, "\n");
  6296.   workingText = workingText.replace (/\<BR[^\>]*\>/gi, "\n");
  6297.   workingText = workingText.replace (/\&\;/gi, "&");
  6298.   workingText = workingText.replace (/\"/gi, """);
  6299.  
  6300.   return workingText;
  6301. }
  6302.  
  6303. function removeMaliciousTags_str_disc ()
  6304. {
  6305.   var workingText = this;
  6306.   workingText = workingText.replace (/\<\s*SCRIPT[^\\>]*\>/gi, " ");
  6307.   workingText = workingText.replace (/\<\s*META[^\\>]*\>/gi, " ");
  6308.   workingText = workingText.replace (/\<\s*\/?\s*BODY[^\\>]*\>/gi, " ");
  6309.   workingText = workingText.replace (/\<\s*\/?\s*HTML[^\\>]*\>/gi, " ");
  6310.  
  6311.   var JSEvents = new RegExp ("\\<[^\\>]*(" + config.SYS_AllJavascriptEvents + ")[^\\>]*\\>", "gi");
  6312.   workingText = workingText.replace (JSEvents, " ");
  6313.  
  6314.   return workingText;
  6315. }
  6316.  
  6317. function fixBrokenTags_str_disc (textToClean)
  6318. {
  6319.   var workingText = this;
  6320.  
  6321.   workingText = workingText.fixTag ("b");
  6322.   workingText = workingText.fixTag ("i");
  6323.   workingText = workingText.fixTag ("u");
  6324.   workingText = workingText.fixTag ("ul");
  6325.   workingText = workingText.fixTag ("ol");
  6326.   workingText = workingText.fixTag ("font");
  6327.   workingText = workingText.fixTag ("h1");
  6328.   workingText = workingText.fixTag ("h2");
  6329.   workingText = workingText.fixTag ("h3");
  6330.   workingText = workingText.fixTag ("h4");
  6331.   workingText = workingText.fixTag ("h5");
  6332.   workingText = workingText.fixTag ("h6");
  6333.   workingText = workingText.fixTag ("table");
  6334.   workingText = workingText.fixTag ("tr");
  6335.   workingText = workingText.fixTag ("th");
  6336.   workingText = workingText.fixTag ("td");
  6337.  
  6338.   return workingText;
  6339. }
  6340.  
  6341. function fixTag_str_disc (tag)
  6342. {
  6343.   var openTag = new RegExp ("\<" + tag + "\>", "gi");
  6344.   var closeTag = new RegExp ("\\<\\s*\\/\\s*" + tag + "[^a-zA-Z0-9][^\\>]*\\>", "gi");
  6345.   var tagDifference = this.countTags (openTag) - this.countTags (closeTag);
  6346.   var additionalTags = "";
  6347.  
  6348.   if (tagDifference > 0)
  6349.     {
  6350.       for (counter = 0; counter < tagDifference; counter++)
  6351.     {
  6352.       additionalTags += "</" + tag + " HTMLFixup>";
  6353.     }
  6354.     }
  6355.  
  6356.   delete openTag;
  6357.   delete closeTag;
  6358.   return this + additionalTags;
  6359. }
  6360.  
  6361. function countTags_str_disc (tag)
  6362. {
  6363.   var counter = 0;
  6364.   var workingText = this;
  6365.   var foundAt = workingText.search (tag);
  6366.  
  6367.   while (foundAt != -1)
  6368.     {
  6369.       counter += 1;
  6370.       workingText = workingText.substr (foundAt + 1, workingText.length - foundAt + 1);
  6371.  
  6372.       foundAt = workingText.search (tag);
  6373.     }
  6374.  
  6375.   return counter;
  6376. }
  6377.  
  6378. function convertComplexTags_str_disc ()
  6379. {
  6380.   var workingText = this;
  6381.   var newText = "";
  6382.   var startAt = workingText.search ("<");
  6383.   var endAt = workingText.search (">") + 1;
  6384.   var linkAt = workingText.search (this.PROTOCOLS_RX_DISC);
  6385.   this.inLink = false;
  6386.  
  6387.   while ((startAt != -1) || (linkAt != -1))
  6388.     {
  6389.       if (((linkAt < startAt) || (startAt == -1)) && (linkAt >= 0) && (!this.inLink))
  6390.     {
  6391.       newText += workingText.substring (0, linkAt);
  6392.       var URL = workingText.substr (linkAt);
  6393.       var URLEnd =  new RegExp (this.END_OF_URL_RX_DISC, "gi");
  6394.       endAt = URL.search (URLEnd);
  6395.       var linkText = workingText.substring (linkAt, endAt);
  6396.       linkText = linkText.stripAllTags ();
  6397.       linkText = linkText.protocolise ();
  6398.       newText += ASPFHTML.A_open (linkText, config.USERTEXT_STRING_WarningUnverifiedLink) + linkText + ASPFHTML.A_close ();
  6399.       workingText = URL.substr (endAt);
  6400.     }
  6401.       else
  6402.     {
  6403.       newText += workingText.substring (0, startAt);
  6404.       newText += workingText.substring (startAt, endAt).sanitiseTag ();
  6405.       workingText = workingText.substr (endAt);
  6406.     }
  6407.  
  6408.       startAt = workingText.search ("<");
  6409.       endAt = workingText.search (">") + 1;
  6410.       linkAt = workingText.search (this.PROTOCOLS_RX_DISC);
  6411.     }
  6412.  
  6413.   return newText + workingText;
  6414. }
  6415.  
  6416. function sanitiseTag_str_disc ()
  6417. {
  6418.   var tag = new ASPFHTML (this);
  6419.  
  6420.   if (tag.isLinkOpen ())
  6421.     {
  6422.       this.inLink = true;
  6423.     }
  6424.   else if (tag.isLinkClose ())
  6425.     {
  6426.       this.inLink = false;
  6427.     }
  6428.  
  6429.   return tag.sanitise ();
  6430. }
  6431.  
  6432. function getAttribute_str_disc (attributeName)
  6433. {
  6434.   var attributeValue;
  6435.   var attribRX = new RegExp (attributeName + "\s*=\s*", "i");
  6436.   var foundAt = this.search (attribRX);
  6437.  
  6438.   if (foundAt > -1)
  6439.     {
  6440.       var subtag = this.substr (foundAt);
  6441.       var tagStart = subtag.search ("=");
  6442.       subtag = subtag.substr (tagStart + 1);
  6443.  
  6444.       var charCount = 0;
  6445.       while ((charCount < subtag.length) && (subtag.charAt (charCount) == " "))
  6446.     {
  6447.       charCount++;
  6448.     }
  6449.  
  6450.       var quoted = false;
  6451.       var quoteUsed = "";
  6452.       if ((subtag.charAt (charCount) == "\"") || (subtag.charAt (charCount) == "'"))
  6453.     {
  6454.       quoted = true;
  6455.       quoteUsed = subtag.charAt (charCount);
  6456.       charCount += 1
  6457.     }
  6458.  
  6459.       subtag = subtag.substr (charCount);
  6460.  
  6461.       var attribEndMarker = "\\s";
  6462.       if (quoted == true)
  6463.     {
  6464.       attribEndMarker = quoteUsed;
  6465.     }
  6466.  
  6467.       var attribEnd = subtag.search (attribEndMarker);
  6468.  
  6469.       attributeValue = subtag.substr (0, attribEnd);
  6470.  
  6471.       if (attributeValue == "")
  6472.     {
  6473.       attributeValue = undefined_disc;
  6474.     }
  6475.     }
  6476.  
  6477.   return attributeValue;
  6478. }
  6479.  
  6480. function protocolise_str_disc ()
  6481. {
  6482.   var protocolisedVersion = "";
  6483.  
  6484.   var protocol = this.substr (0, this.indexOf ("//"));
  6485.  
  6486.   switch (protocol)
  6487.     {
  6488.     case "http:":
  6489.     case "ftp:":
  6490.     case "https:":
  6491.     case "gopher:":
  6492.     case "file:":
  6493.       protocolisedVersion = this;
  6494.       break;
  6495.  
  6496.     default:
  6497.       protocolisedVersion = "http://" + this;
  6498.       break;
  6499.     }
  6500.  
  6501.   return protocolisedVersion;
  6502. }
  6503.  
  6504. function precis_str_disc ()
  6505. {
  6506.   var precisString = this;
  6507.  
  6508.   if (precisString.length > config.ADMINSETTING_PrecisLength)
  6509.     {
  6510.       precisString = precisString.substr(0, config.ADMINSETTING_PrecisLength) + config.USERTEXT_STRING_StringTruncatedSuffix;
  6511.     }
  6512.  
  6513.   precisString = precisString.replace (/\<P.*\>/gi, " ");
  6514.   precisString = precisString.replace (/\<\/P[^\\>]*\>/gi, " ");
  6515.   precisString = precisString.replace (/\<BR[^\\>]*\>/gi, " ");
  6516.   precisString = precisString.replace (/\<BLOCKQUOTE.*\>/gi, " ");
  6517.   precisString = precisString.replace (/\<\/BLOCKQUOTE.*\>/gi, " ");
  6518.  
  6519.   if (precisString.lastIndexOf (">") < precisString.lastIndexOf ("<"))
  6520.     {
  6521.       precisString = precisString.substr (0, precisString.lastIndexOf ("<"));
  6522.     }
  6523.  
  6524.   return precisString;
  6525. }
  6526.  
  6527. function stripAllTags_str_disc ()
  6528. {
  6529.   return this.replace (/\<.*\>/gi, " ");
  6530. }
  6531.  
  6532. String.prototype.PROTOCOLS_RX_DISC = "(http://)|(www\\.)|(ftp://)|(https://)|(gopher://)|(file://)|(mailto:)|(news:)|(telnet:)|(wais:)";
  6533. String.prototype.END_OF_URL_RX_DISC = "[^A-Za-z0-9\.:;,=@_&\\/\\?\\+\\$\\{\\}\\\"]";
  6534.  
  6535. String.prototype.strong = strong_str_disc;
  6536. String.prototype.strongBig = strongBig_str_disc;
  6537. String.prototype.strongSmall = strongSmall_str_disc;
  6538. String.prototype.weak = weak_str_disc;
  6539. String.prototype.weakBig = weakBig_str_disc;
  6540. String.prototype.weakSmall = weakSmall_str_disc;
  6541. String.prototype.messageBody = messageBody_str_disc;
  6542. String.prototype.paragraph = paragraph_str_disc;
  6543. String.prototype.show = show_str_disc;
  6544. String.prototype.formatForURL = formatForURL_str_disc;
  6545. String.prototype.safeFormat = safeFormat_str_disc;
  6546. String.prototype.javascriptSafeFormat = javascriptSafeFormat_str_disc;
  6547. String.prototype.HTMLiseLinefeeds = HTMLiseLinefeeds_str_disc;
  6548. String.prototype.purify = purify_str_disc;
  6549. String.prototype.formatForStoring = formatForStoring_str_disc;
  6550. String.prototype.unformatFromStoring = unformatFromStoring_str_disc;
  6551. String.prototype.removeMaliciousTags = removeMaliciousTags_str_disc;
  6552. String.prototype.fixBrokenTags = fixBrokenTags_str_disc;
  6553. String.prototype.fixTag = fixTag_str_disc;
  6554. String.prototype.countTags = countTags_str_disc;
  6555. String.prototype.convertComplexTags = convertComplexTags_str_disc;
  6556. String.prototype.sanitiseTag = sanitiseTag_str_disc;
  6557. String.prototype.getAttribute = getAttribute_str_disc;
  6558. String.prototype.protocolise = protocolise_str_disc;
  6559. String.prototype.precis = precis_str_disc;
  6560. String.prototype.stripAllTags = stripAllTags_str_disc;
  6561. </SCRIPT>
  6562.  
  6563. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  6564. //=======================================================================
  6565. //
  6566. // "ASP Forums" - a web-based discussion forum implementation.
  6567. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  6568. //
  6569. // This library is free software; you can redistribute it and/or
  6570. // modify it under the terms of the GNU Lesser General Public
  6571. // License as published by the Free Software Foundation; either
  6572. // version 2.1 of the License, or (at your option) any later version.
  6573. //
  6574. // This library is distributed in the hope that it will be useful,
  6575. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  6576. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  6577. // Lesser General Public License for more details.
  6578. //
  6579. // You should have received a copy of the GNU Lesser General Public
  6580. // License along with this library; if not, write to the Free Software
  6581. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  6582. //
  6583. //=======================================================================
  6584.  
  6585. //=======================================================================
  6586. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  6587. //=======================================================================
  6588.  
  6589. // ======================================================================
  6590. //
  6591. // TEXTCONTROL OBJECT
  6592. //
  6593. // ======================================================================
  6594.  
  6595. function ASPFTextControl (name, contents, formName)
  6596. {
  6597.   this.controlName = name;
  6598.  
  6599.   if (isDefined_disc (contents))
  6600.     {
  6601.       this.contents = contents;
  6602.     }
  6603.   else
  6604.     {
  6605.       this.contents = "";
  6606.     }
  6607.  
  6608.   if (isDefined_disc (formName))
  6609.     {
  6610.       this.formName = formName;
  6611.     }
  6612.   else
  6613.     {
  6614.       this.formName = "ASPF";
  6615.     }
  6616.  
  6617.   return this;
  6618. }
  6619.  
  6620. function isUsed_txt_disc ()
  6621. {
  6622.   return ASPFTextControl.initialised;
  6623. }
  6624.  
  6625. function getImageLoader_txt_disc ()
  6626. {
  6627.   var JSout = ASPFHTML.JS_open ();
  6628.  
  6629.   JSout += "var buttonImage_normal = new Image ();\n";
  6630.   JSout += "buttonImage_normal.src = \"" + config.ADMINSETTING_ToolbarButtonImagePathname + "\";\n";
  6631.   JSout += "var buttonImage_up = new Image ();\n";
  6632.   JSout += "buttonImage_up.src = \"" + config.ADMINSETTING_ToolbarButtonImageUpPathname + "\";\n";
  6633.   JSout += "var buttonImage_down = new Image ();\n";
  6634.   JSout += "buttonImage_down.src = \"" + config.ADMINSETTING_ToolbarButtonImageDownPathname + "\";\n\n";
  6635.  
  6636.   JSout += ASPFHTML.JS_close ();
  6637.  
  6638.   return JSout;
  6639. }
  6640.  
  6641. function getGenericRoutines_txt_disc ()
  6642. {
  6643.   var JSout = ASPFHTML.JS_open ();
  6644.   JSout += "function flipImage_disc (imageTagName, newImageObject)\n";
  6645.   JSout += "{\n";
  6646.   JSout += "\tif (document.images)\n";
  6647.   JSout += "\t{\n";
  6648.   JSout += "\t\tdocument [imageTagName].src = newImageObject.src;\n";
  6649.   JSout += "\t}\n\n";
  6650.   JSout += "\treturn;\n";
  6651.   JSout += "}\n\n";
  6652.   JSout += ASPFHTML.JS_close ();
  6653.  
  6654.   return JSout;
  6655. }
  6656.  
  6657. function getControlSpecificRoutines_txt_disc (controlName)
  6658. {
  6659.   var JSout = ASPFHTML.JS_open ();
  6660.   JSout += "function submitRecord ()\n";
  6661.   JSout += "{\n";
  6662.   JSout += "\tvar text = frames." + controlName + ".document.body.innerText;\n";
  6663.   JSout += "\tvar html = frames." + controlName + ".document.body.innerHTML;\n";
  6664.   JSout += "\tif ((html == \"\") || (text == \"\"))\n";
  6665.   JSout += "\t{\n";
  6666.   JSout += "\t\tframes." + controlName + ".focus();\n";
  6667.   JSout += "\t\talert (\"Body field must not be empty.\");\n";
  6668.   JSout += "\t\treturn;\n";
  6669.   JSout += "\t}\n";
  6670.   JSout += "\tdocument." + this.formName + "." + controlName + ".value = html;\n";
  6671.   JSout += "\tdocument." + this.formName + ".submit();\n";
  6672.   JSout += "\treturn;\n";
  6673.   JSout += "}\n\n";
  6674.  
  6675.   JSout += "function setStyle_" + controlName + " (newStyle)\n";
  6676.   JSout += "{\n";
  6677.   JSout += "\tvar selection = frames." + controlName + ".document.selection.createRange ();\n";
  6678.   JSout += "\tselection.execCommand (newStyle);\n";
  6679.   JSout += "\tframes." + controlName + ".focus();\n";
  6680.   JSout += "\treturn;\n";
  6681.   JSout += "}\n\n";
  6682.  
  6683.   JSout += "function setFont_" + controlName + " ()\n";
  6684.   JSout += "{\n";
  6685.   JSout += "\tvar selectedRange = frames." + controlName + ".document.selection.createRange ();\n";
  6686.   JSout += "\tselectedRange.execCommand (\"FontName\", true, document." + this.formName + ".FontName.options [document." + this.formName + ".FontName.selectedIndex].value);\n";
  6687.   JSout += "\tselectedRange.execCommand (\"FontSize\", true, document." + this.formName + ".FontSize.options [document." + this.formName + ".FontSize.selectedIndex].value);\n";
  6688.   JSout += "\tselectedRange.select ();\n";
  6689.   JSout += "\tframes." + controlName + ".focus();\n";
  6690.   JSout += "\treturn;\n";
  6691.   JSout += "}\n\n";
  6692.  
  6693.   JSout += ASPFHTML.JS_close ();
  6694.  
  6695.   return JSout;
  6696. }
  6697.  
  6698. function getImageControlHTML_txt_disc (control, name, command, title, pathname, width, height)
  6699. {
  6700.   var HTMLout = "";
  6701.   HTMLout += "<IMG ALT=\"" + name + "\" HEIGHT=\"" + height + "\" WIDTH=\"" + width;
  6702.   HTMLout += "\" NAME=\"" + title + "\" SRC=\"" + pathname + "\" onclick=\"flipImage_disc ('" + title + "', '" + title;
  6703.   HTMLout += "Image_down'); setStyle_" + control + " ('" + command + "'); return false;\" onmouseover=\"flipImage_disc ('";
  6704.   HTMLout += title + "', '" + title + "Image_up');\" onmouseout=\"flipImage_disc ('" + title + "', '" + title + "Image_normal');\">";
  6705.  
  6706.   return HTMLout;
  6707. }
  6708.  
  6709. function getControlActivator_txt_disc (controlName)
  6710. {
  6711.   var HTMLout = "";
  6712.   HTMLout += ASPFHTML.JS_open ();
  6713.   HTMLout += "var editControl = frames." + controlName + ".document;\n";
  6714.   HTMLout += "editControl.designMode = \"On\";\n";
  6715.   if (isDefined_disc (this.contents) && (this.contents != ""))
  6716.     {
  6717.       HTMLout += "editControl.write (\"" + this.contents.javascriptSafeFormat () + "\");\n";
  6718.     }
  6719.   HTMLout += ASPFHTML.JS_close ();
  6720.  
  6721.   return HTMLout;
  6722. }
  6723.  
  6724. function getToolbarButtonControl_txt_disc (controlName, buttonName, buttonTitle, buttonAction)
  6725. {
  6726.   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;");
  6727. }
  6728.  
  6729. function getToolbarSpacer_txt_disc ()
  6730. {
  6731.   return ASPFHTML.IMG (config.ADMINSETTING_ToolbarSpacerImagePathname, " ", 0, config.ADMINSETTING_ToolbarSpacerImageWidth, config.ADMINSETTING_ToolbarSpacerImageHeight);
  6732. }
  6733.  
  6734. function getToolbarButtons_txt_disc (controlName)
  6735. {
  6736.   var HTMLout = ASPFHTML.TABLE_open (0, 300, undefined_disc, undefined_disc, 0, 0);
  6737.   HTMLout += ASPFHTML.TR_open ();
  6738.   HTMLout += ASPFHTML.TD_open (5);
  6739.   HTMLout += this.getToolbarSpacer ();
  6740.   HTMLout += ASPFHTML.TD_close ();
  6741.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6742.   HTMLout += this.getToolbarButtonControl (controlName, "bold", "Bold", "bold");
  6743.   HTMLout += ASPFHTML.TD_close ();
  6744.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6745.   HTMLout += this.getToolbarButtonControl (controlName, "italic", "Italic", "italic");
  6746.   HTMLout += ASPFHTML.TD_close ();
  6747.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6748.   HTMLout += this.getToolbarButtonControl (controlName, "underline", "Underline", "underline");
  6749.   HTMLout += ASPFHTML.TD_close ();
  6750.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6751.   HTMLout += this.getToolbarSpacer ();
  6752.   HTMLout += ASPFHTML.TD_close ();
  6753.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6754.   HTMLout += this.getToolbarButtonControl (controlName, "justifyleft", "Left", "JustifyLeft");
  6755.   HTMLout += ASPFHTML.TD_close ();
  6756.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6757.   HTMLout += this.getToolbarButtonControl (controlName, "justifycenter", "Centre", "JustifyCenter");
  6758.   HTMLout += ASPFHTML.TD_close ();
  6759.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6760.   HTMLout += this.getToolbarButtonControl (controlName, "justifyright", "Right", "JustifyRight");
  6761.   HTMLout += ASPFHTML.TD_close ();
  6762.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6763.   HTMLout += this.getToolbarButtonControl (controlName, "justifyfull", "Justify", "JustifyFull");
  6764.   HTMLout += ASPFHTML.TD_close ();
  6765.   HTMLout += ASPFHTML.TD_open (5);
  6766.   HTMLout += this.getToolbarSpacer ();
  6767.   HTMLout += ASPFHTML.TD_close ();
  6768.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6769.   HTMLout += this.getToolbarButtonControl (controlName, "bulleted", "Bulleted List", "InsertUnorderedList");
  6770.   HTMLout += ASPFHTML.TD_close ();
  6771.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6772.   HTMLout += this.getToolbarButtonControl (controlName, "numbered", "Numbered List", "InsertOrderedList");
  6773.   HTMLout += ASPFHTML.TD_close ();
  6774.   HTMLout += ASPFHTML.TD_open (5);
  6775.   HTMLout += this.getToolbarSpacer ();
  6776.   HTMLout += ASPFHTML.TD_close ();
  6777.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6778.   HTMLout += this.getToolbarButtonControl (controlName, "indent", "Indent", "Indent");
  6779.   HTMLout += ASPFHTML.TD_close ();
  6780.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarButtonImageWidth);
  6781.   HTMLout += this.getToolbarButtonControl (controlName, "outdent", "outdent", "Outdent");
  6782.   HTMLout += ASPFHTML.TD_close ();
  6783.   HTMLout += ASPFHTML.TD_open (5);
  6784.   HTMLout += this.getToolbarSpacer ();
  6785.   HTMLout += ASPFHTML.TD_close ();
  6786.   HTMLout += ASPFHTML.TR_close ();
  6787.   HTMLout += ASPFHTML.TABLE_close ();
  6788.  
  6789.   return HTMLout;
  6790. }
  6791.  
  6792. function getControlHTML_txt_disc (controlName)
  6793. {
  6794.   var controlWidth = 9 * config.ADMINSETTING_TextAreaCols;
  6795.   var controlHeight = 20 * config.ADMINSETTING_TextAreaRows;
  6796.   var HTMLout = ASPFHTML.TABLE_open (0, controlWidth, config.ADMINSETTING_ToolbarBackgroundColour, undefined_disc, 0, 0);
  6797.   HTMLout += ASPFHTML.TR_open ();
  6798.   HTMLout += ASPFHTML.TD_open (config.ADMINSETTING_ToolbarTotalWidth, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, undefined_disc, config.ADMINSETTING_ToolbarImagePathname);
  6799.   HTMLout += this.getToolbarButtons (controlName);
  6800.   HTMLout += ASPFHTML.TD_close ();
  6801.   HTMLout += ASPFHTML.TD_open (controlWidth - config.ADMINSETTING_ToolbarTotalWidth);
  6802.   HTMLout += ASPFHTML.SELECT_open ("FontName", "setFont_" + controlName + " (); return false;");
  6803.   HTMLout += ASPFHTML.OPTION ("Courier, Century") + "Courier";
  6804.   HTMLout += ASPFHTML.OPTION ("Helvetica, Arial, sans serif") + "Helvetica";
  6805.   HTMLout += ASPFHTML.OPTION ("Times New Roman, serif", true) + "Times";
  6806.   HTMLout += ASPFHTML.SELECT_close ();
  6807.   HTMLout += ASPFHTML.SELECT_open ("FontSize", "setFont_" + controlName + " (); return false;");
  6808.   HTMLout += ASPFHTML.OPTION ("1") + "8pt";
  6809.   HTMLout += ASPFHTML.OPTION ("2") + "10pt";
  6810.   HTMLout += ASPFHTML.OPTION ("3", true) + "12pt";
  6811.   HTMLout += ASPFHTML.OPTION ("4") + "14pt";
  6812.   HTMLout += ASPFHTML.OPTION ("5") + "18pt";
  6813.   HTMLout += ASPFHTML.OPTION ("6") + "24pt";
  6814.   HTMLout += ASPFHTML.OPTION ("7") + "36pt";
  6815.   HTMLout += ASPFHTML.SELECT_close ();
  6816.   HTMLout += ASPFHTML.TD_close ();
  6817.   HTMLout += ASPFHTML.TR_close ();
  6818.   HTMLout += ASPFHTML.TABLE_close ();
  6819.   HTMLout += ASPFHTML.IFRAME_open (controlName, controlName, controlWidth, controlHeight);
  6820.   HTMLout += ASPFHTML.IFRAME_close ();
  6821.   HTMLout += ASPFHTML.BR ();
  6822.   HTMLout += ASPFHTML.INPUT_hidden (controlName, "");
  6823.  
  6824.   return HTMLout;
  6825. }
  6826.  
  6827. function isRichTextCapable_txt_disc ()
  6828. {
  6829.   var clientCanHandleIt;
  6830.   if ((String (Request.ServerVariables ("HTTP_USER_AGENT")).indexOf ("MSIE 4") > 0) || (String (Request.ServerVariables ("HTTP_USER_AGENT")).indexOf ("MSIE 5") > 0))
  6831.     {
  6832.       clientCanHandleIt = true;
  6833.     }
  6834.   else
  6835.     {
  6836.       clientCanHandleIt = false;
  6837.     }
  6838.  
  6839.   return clientCanHandleIt;
  6840. }
  6841.  
  6842. function getControl_txt_disc ()
  6843. {
  6844.   var HTMLout;
  6845.   if (this.isRichTextCapable ())
  6846.     {
  6847.       ASPFTextControl.initialised = true;
  6848.       HTMLout = this.getImageLoader ();
  6849.       HTMLout += this.getGenericRoutines ();
  6850.       HTMLout += this.getControlSpecificRoutines (this.controlName);
  6851.       HTMLout += this.getControlHTML (this.controlName);
  6852.       HTMLout += this.getControlActivator (this.controlName);
  6853.     }
  6854.   else
  6855.     {
  6856.       ASPFTextControl.initialised = false;
  6857.       HTMLout = ASPFHTML.TEXTAREA_open (this.controlName, config.ADMINSETTING_TextAreaCols, config.ADMINSETTING_TextAreaRows) + this.contents.unformatFromStoring () + ASPFHTML.TEXTAREA_close ();
  6858.     }
  6859.  
  6860.   return HTMLout;
  6861. }
  6862.  
  6863. function getControlContents_txt_disc (formData, controlName)
  6864. {
  6865.   var contents;
  6866.   if (this.isRichTextCapable ())
  6867.     {
  6868.       contents = formData (controlName);
  6869.     }
  6870.   else
  6871.     {
  6872.       contents = String (formData (controlName)).HTMLiseLinefeeds ();
  6873.     }
  6874.  
  6875.   return contents;
  6876. }
  6877.  
  6878. ASPFTextControl.initialised = false;
  6879. ASPFTextControl.isUsed = isUsed_txt_disc;
  6880. ASPFTextControl.isRichTextCapable = isRichTextCapable_txt_disc;
  6881. ASPFTextControl.getControlContents = getControlContents_txt_disc;
  6882.  
  6883. ASPFTextControl.prototype.isUsed = isUsed_txt_disc;
  6884. ASPFTextControl.prototype.getImageLoader = getImageLoader_txt_disc;
  6885. ASPFTextControl.prototype.getGenericRoutines = getGenericRoutines_txt_disc;
  6886. ASPFTextControl.prototype.getControlSpecificRoutines = getControlSpecificRoutines_txt_disc;
  6887. ASPFTextControl.prototype.getImageControlHTML = getImageControlHTML_txt_disc;
  6888. ASPFTextControl.prototype.getControlActivator = getControlActivator_txt_disc;
  6889. ASPFTextControl.prototype.getToolbarButtonControl = getToolbarButtonControl_txt_disc;
  6890. ASPFTextControl.prototype.getToolbarSpacer = getToolbarSpacer_txt_disc;
  6891. ASPFTextControl.prototype.getToolbarButtons = getToolbarButtons_txt_disc;
  6892. ASPFTextControl.prototype.getControlHTML = getControlHTML_txt_disc;
  6893. ASPFTextControl.prototype.getControl = getControl_txt_disc;
  6894. ASPFTextControl.prototype.isRichTextCapable = isRichTextCapable_txt_disc;
  6895. ASPFTextControl.prototype.getControlContents = getControlContents_txt_disc;
  6896. </SCRIPT>
  6897.  
  6898. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  6899. //=======================================================================
  6900. //
  6901. // "ASP Forums" - a web-based discussion forum implementation.
  6902. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  6903. //
  6904. // This library is free software; you can redistribute it and/or
  6905. // modify it under the terms of the GNU Lesser General Public
  6906. // License as published by the Free Software Foundation; either
  6907. // version 2.1 of the License, or (at your option) any later version.
  6908. //
  6909. // This library is distributed in the hope that it will be useful,
  6910. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  6911. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  6912. // Lesser General Public License for more details.
  6913. //
  6914. // You should have received a copy of the GNU Lesser General Public
  6915. // License along with this library; if not, write to the Free Software
  6916. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  6917. //
  6918. //=======================================================================
  6919.  
  6920. //=======================================================================
  6921. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  6922. //=======================================================================
  6923.  
  6924. // ======================================================================
  6925. //
  6926. // THREAD OBJECT
  6927. //
  6928. // ======================================================================
  6929.  
  6930. function ASPFThread (currentMessageID, pageURLToUse)
  6931. {
  6932.   this.currentMessageID = currentMessageID;
  6933.   if (isUndefined_disc (pageURLToUse))
  6934.     {
  6935.       this.pageURLToUse = config.getMainPagePath ();
  6936.     }
  6937.   else
  6938.     {
  6939.       this.pageURLToUse = pageURLToUse;
  6940.     }
  6941.  
  6942.   return this;
  6943. }
  6944.  
  6945. // ======================================================================
  6946. //
  6947. // Interface to private member variables.
  6948. //
  6949. // ======================================================================
  6950.  
  6951. function getCurrentMessageID_thd_disc ()
  6952. {
  6953.   return this.currentMessageID;
  6954. }
  6955.  
  6956. function setCurrentMessageID_thd_disc (newCurrentMessageID)
  6957. {
  6958.   this.currentMessageID = newCurrentMessageID;
  6959.   return;
  6960. }
  6961.  
  6962. // ======================================================================
  6963. //
  6964. // Main object methods.
  6965. //
  6966. // ======================================================================
  6967.  
  6968. function getAllSorted_thd_disc (sortAscending)
  6969. {
  6970.   var dbase = new ASPFDatabase ();
  6971.   var messages = dbase.getAllRootMessages(sortAscending);
  6972.   var messageView = new ASPFView (messages, this.currentMessageID);
  6973.   var threadInfo = messageView.getView ();
  6974.  
  6975.   delete dbase;
  6976.   delete messages;
  6977.   delete messageView;
  6978.   return threadInfo;
  6979. }
  6980.  
  6981. function getCurrentSorted_thd_disc (sortAscending)
  6982. {
  6983.   var dbase = new ASPFDatabase ();
  6984.   var messages = dbase.getCurrentRootMessages (sortAscending);
  6985.   var messageView = new ASPFView (messages, this.currentMessageID);
  6986.   var threadInfo = messageView.getView ();
  6987.  
  6988.   delete dbase;
  6989.   delete messages;
  6990.   delete messageView;
  6991.   return threadInfo;
  6992. }
  6993.  
  6994. function getCurrentSortedDHTML_thd_disc (sortAscending)
  6995. {
  6996.   var dbase = new ASPFDatabase ();
  6997.   var messages = dbase.getAllCurrentMessages (sortAscending);
  6998.   var messageView = new ASPFView (messages, this.currentMessageID);
  6999.   var threadInfo = messageView.getDHTMLView ();
  7000.  
  7001.   delete dbase;
  7002.   delete messages;
  7003.   delete messageView;
  7004.   return threadInfo;
  7005. }
  7006.  
  7007. function getArchiveSorted_thd_disc (archiveDate, sortAscending)
  7008. {
  7009.   var dbase = new ASPFDatabase ();
  7010.   var messages = dbase.getArchiveRootMessages (archiveDate, sortAscending);
  7011.   var messageView = new ASPFView (messages, this.currentMessageID, config.getArchivePagePath ());
  7012.   var threadInfo = messageView.getView ();
  7013.  
  7014.   delete dbase;
  7015.   delete messages;
  7016.   delete messageView;
  7017.   return threadInfo;
  7018. }
  7019.  
  7020. function getArchiveSortedDHTML_thd_disc (archiveDate, sortAscending)
  7021. {
  7022.   var dbase = new ASPFDatabase ();
  7023.   var messages = dbase.getAllArchiveMessages (archiveDate, sortAscending);
  7024.   var messageView = new ASPFView (messages, this.currentMessageID, config.getArchivePagePath ());
  7025.   var threadInfo = messageView.getDHTMLView ();
  7026.  
  7027.   delete dbase;
  7028.   delete messages;
  7029.   delete messageView;
  7030.   return threadInfo;
  7031. }
  7032.  
  7033. function getExpandedThread_thd_disc (threadID, startAt)
  7034. {
  7035.   var dbase = new ASPFDatabase ();
  7036.   var messages = dbase.getSubThreadMessages (threadID, startAt);
  7037.   var messageView = new ASPFView (messages, this.currentMessageID, this.pageURLToUse);
  7038.   var expandedThread = messageView.getViewThread ();
  7039.  
  7040.   delete dbase;
  7041.   delete messages;
  7042.   delete messageView;
  7043.   return expandedThread;
  7044. }
  7045.  
  7046. function getSubThread_thd_disc (threadID, startAt)
  7047. {
  7048.   var dbase = new ASPFDatabase ();
  7049.   var messages = dbase.getSubThreadMessages (threadID, startAt);
  7050.   var messageView = new ASPFView (messages, this.currentMessageID);
  7051.   var subThread = messageView.getViewFullThread ();
  7052.  
  7053.   delete dbase;
  7054.   delete messages;
  7055.   delete messageView;
  7056.   return subThread;
  7057. }
  7058.  
  7059. function getFullThread_thd_disc (threadID)
  7060. {
  7061.   var dbase = new ASPFDatabase ();
  7062.   var messages = dbase.getAllThreadMessages (threadID);
  7063.   var messageView = new ASPFView (messages, this.currentMessageID);
  7064.   var threadLayout = messageView.getViewFullThread ();
  7065.  
  7066.   delete dbase;
  7067.   delete messages;
  7068.   delete messageView;
  7069.   return threadLayout;
  7070. }
  7071.  
  7072. ASPFThread.prototype.getCurrentMessageID = getCurrentMessageID_thd_disc;
  7073. ASPFThread.prototype.setCurrentMessageID = setCurrentMessageID_thd_disc;
  7074.  
  7075. ASPFThread.prototype.getAllSorted = getAllSorted_thd_disc;
  7076. ASPFThread.prototype.getCurrentSorted = getCurrentSorted_thd_disc;
  7077. ASPFThread.prototype.getCurrentSortedDHTML = getCurrentSortedDHTML_thd_disc;
  7078. ASPFThread.prototype.getArchiveSorted = getArchiveSorted_thd_disc;
  7079. ASPFThread.prototype.getArchiveSortedDHTML = getArchiveSortedDHTML_thd_disc;
  7080. ASPFThread.prototype.getExpandedThread = getExpandedThread_thd_disc;
  7081. ASPFThread.prototype.getSubThread = getSubThread_thd_disc;
  7082. ASPFThread.prototype.getFullThread = getFullThread_thd_disc;
  7083. </SCRIPT>
  7084.  
  7085. <SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  7086. //=======================================================================
  7087. //
  7088. // "ASP Forums" - a web-based discussion forum implementation.
  7089. // Copyright (C) 1999, 2000  ASP Forums, http://www.aspforums.com/
  7090. //
  7091. // This library is free software; you can redistribute it and/or
  7092. // modify it under the terms of the GNU Lesser General Public
  7093. // License as published by the Free Software Foundation; either
  7094. // version 2.1 of the License, or (at your option) any later version.
  7095. //
  7096. // This library is distributed in the hope that it will be useful,
  7097. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  7098. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  7099. // Lesser General Public License for more details.
  7100. //
  7101. // You should have received a copy of the GNU Lesser General Public
  7102. // License along with this library; if not, write to the Free Software
  7103. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  7104. //
  7105. //=======================================================================
  7106.  
  7107. //=======================================================================
  7108. // ASP Forums version 2.0 beta 2 - July 20th 2000.
  7109. //=======================================================================
  7110.  
  7111. // ======================================================================
  7112. //
  7113. // VIEW OBJECT
  7114. //
  7115. // ======================================================================
  7116.  
  7117. function ASPFView (messages, currentMessageID, pageURLToUse)
  7118. {
  7119.   this.messages = messages;
  7120.   this.currentMessageID = currentMessageID;
  7121.   if (isUndefined_disc (pageURLToUse))
  7122.     {
  7123.       this.pageURLToUse = config.getMainPagePath ();
  7124.     }
  7125.   else
  7126.     {
  7127.       this.pageURLToUse = pageURLToUse;
  7128.     }
  7129.  
  7130.   return this;
  7131. }
  7132.  
  7133. // ======================================================================
  7134. //
  7135. // Interface to private member variables.
  7136. //
  7137. // ======================================================================
  7138.  
  7139. function getMessageList_vw_disc ()
  7140. {
  7141.   return this.messages;
  7142. }
  7143.  
  7144. function setMessageList_vw_disc (newMessageList)
  7145. {
  7146.   this.messages = newMessageList;
  7147.   return;
  7148. }
  7149.  
  7150. function getCurrentMessageID_vw_disc ()
  7151. {
  7152.   return this.currentMessageID;
  7153. }
  7154.  
  7155. function setCurrentMessageID_vw_disc (newCurrentMessageID)
  7156. {
  7157.   this.currentMessageID = newCurrentMessageID;
  7158.   return;
  7159. }
  7160.  
  7161. // ======================================================================
  7162. //
  7163. // Main object methods.
  7164. //
  7165. // ======================================================================
  7166.  
  7167. function getView_vw_disc ()
  7168. {
  7169.   if (this.messages.EOF)
  7170.     {
  7171.       return String (config.USERTEXT_VIEW_NoMessages).weak();
  7172.     }
  7173.   this.messages.MoveFirst();
  7174.  
  7175.   var currentMessage;
  7176.   var viewLine;
  7177.   var view = "";
  7178.   var viewCounter = 0;
  7179.   var showMaxRecords;
  7180.   if (config.ADMINSETTING_StaticViewShowAtMostNRecords > 0)
  7181.     {
  7182.       showMaxRecords = config.ADMINSETTING_StaticViewShowAtMostNRecords;
  7183.     }
  7184.   else
  7185.     {
  7186.       showMaxRecords = this.messages.RecordCount;
  7187.     }
  7188.  
  7189.   while ((!this.messages.EOF) && (viewCounter < showMaxRecords))
  7190.     {
  7191.       viewCounter += 1;
  7192.  
  7193.       currentMessage = new ASPFMessage (this.messages);
  7194.       var expandCollapse = new ASPFExpandCollapse (currentMessage, viewCounter, currentMessage.getMessageID (), 0, this.pageURLToUse);
  7195.       if (expandCollapse.doWeExpand())
  7196.     {
  7197.       var expandedThread = new ASPFThread (this.currentMessageID, this.pageURLToUse);
  7198.       view += expandedThread.getExpandedThread (currentMessage.getThreadID (), currentMessage.getSortCode ());
  7199.       delete expandedThread;
  7200.     }
  7201.       else
  7202.     {
  7203.       viewLine = currentMessage.getExpandCollapse (viewCounter, 1, this.pageURLToUse) + currentMessage.getViewEntry (this.currentMessageID);
  7204.       view += this.getIndented (1, viewLine);
  7205.     }
  7206.  
  7207.       delete currentMessage;
  7208.       delete expandCollapse;
  7209.       this.messages.MoveNext();
  7210.     }
  7211.  
  7212.   return view;
  7213. }
  7214.  
  7215. function getDHTMLView_vw_disc ()
  7216. {
  7217.   if (this.messages.EOF)
  7218.     {
  7219.       return String (config.USERTEXT_VIEW_NoMessages).weak();
  7220.     }
  7221.  
  7222.   this.messages.MoveFirst();
  7223.  
  7224.   var view = this.getDHTMLExpandCollapseCode ();
  7225.  
  7226.   while (!this.messages.EOF)
  7227.     {
  7228.       view += this.getDHTMLThread (this.messages);
  7229.     }
  7230.  
  7231.   return view;
  7232. }
  7233.  
  7234. function getDHTMLThread_vw_disc (messages)
  7235. {
  7236.   var relativeIndentLevel;
  7237.   var absoluteIndentLevel;
  7238.   var sortCode;
  7239.   var currentMessage;
  7240.   var subjectLine;
  7241.  
  7242.   relativeIndentLevel = 1;
  7243.   currentMessage = new ASPFMessage (messages);
  7244.   absoluteIndentLevel = this.getSortcodeIndentLevel (currentMessage.getSortCode ());
  7245.   sortCode = currentMessage.getSortCode ();
  7246.   subjectLine = currentMessage.getDHTMLExpandCollapse (relativeIndentLevel, this.pageURLToUse) + currentMessage.getViewEntry (0);
  7247.  
  7248.   var currentID = String (currentMessage.getMessageID ());
  7249.   var currentSortCode = String (currentMessage.getSortCode ());
  7250.  
  7251.   delete currentMessage;
  7252.   return this.getIndented (relativeIndentLevel, subjectLine) + this.getDHTMLChildren (currentID, currentSortCode, absoluteIndentLevel, relativeIndentLevel, sortCode, messages);
  7253. }
  7254.  
  7255. function getDHTMLChildren_vw_disc (previousID, previousSortCode, absoluteIndentLevel, relativeIndentLevel, workingSortCode, messages)
  7256. {
  7257.   var viewLine = "";
  7258.   var displaySubthread = "";
  7259.  
  7260.   messages.MoveNext ()
  7261.     var nextMessage = new ASPFMessage (messages);
  7262.   if (previousSortCode == nextMessage.getSortCode ().substring (0, previousSortCode.length))
  7263.     {
  7264.       if (previousSortCode == nextMessage.getSortCode ().substring (0, previousSortCode.length))
  7265.     {
  7266.       absoluteIndentLevel++;
  7267.       relativeIndentLevel++;
  7268.     }
  7269.  
  7270.       if (relativeIndentLevel == 2)
  7271.     {
  7272.       displaySubthread = "none";
  7273.     }
  7274.       else
  7275.     {
  7276.       displaySubthread = "";
  7277.     }
  7278.       viewLine += ASPFHTML.DIV_open ("Subthread-" + previousID, "margin-left:0;display:" + displaySubthread + ";");
  7279.  
  7280.       var messageOutputCounter = 0;
  7281.       while (!messages.EOF && (previousSortCode == nextMessage.getSortCode ().substring (0, previousSortCode.length)))
  7282.     {
  7283.       subjectLine = nextMessage.getDHTMLExpandCollapse (relativeIndentLevel, this.pageURLToUse) + nextMessage.getViewEntry (0);
  7284.       viewLine += this.getIndented (relativeIndentLevel, subjectLine);
  7285.       viewLine += this.getDHTMLChildren (String (nextMessage.getMessageID ()), nextMessage.getSortCode (), absoluteIndentLevel, relativeIndentLevel, nextMessage.getSortCode (), messages);
  7286.       delete nextMessage;
  7287.       nextMessage = new ASPFMessage (messages);
  7288.       messageOutputCounter++;
  7289.     }
  7290.  
  7291.       viewLine += ASPFHTML.DIV_close ();
  7292.     }
  7293.  
  7294.   delete nextMessage;
  7295.   return viewLine;
  7296. }
  7297.  
  7298. function getViewThread_vw_disc ()
  7299. {
  7300.   if (this.messages.EOF)
  7301.     {
  7302.       return String (config.USERTEXT_VIEW_NoMessages).weak();
  7303.     }
  7304.   this.messages.MoveFirst();
  7305.  
  7306.   var lastIndentLevel;
  7307.   var currentIndentLevel;
  7308.   var viewLine;
  7309.   var firstMessageSortCode;
  7310.   var thread = "";
  7311.   var viewCounter = 0;
  7312.  
  7313.   lastIndentLevel = 0;
  7314.   var dBase = new ASPFDatabase ();
  7315.   firstMessageSortCode = String (dBase.getSortCodeField (this.messages));
  7316.  
  7317.   while (!this.messages.EOF)
  7318.     {
  7319.       viewCounter += 1;
  7320.  
  7321.       var currentMessage = new ASPFMessage (this.messages);
  7322.       var expandCollapseThread = new ASPFExpandCollapse (currentMessage, viewCounter, 0, 0, this.pageURLToUse);
  7323.  
  7324.       currentIndentLevel = 1 + this.getIndentLevel () - this.getSortcodeIndentLevel (firstMessageSortCode);
  7325.       if (currentIndentLevel < 1)
  7326.     {
  7327.       currentIndentLevel = 1;
  7328.       firstMessageSortCode = String (dBase.getSortCodeField (this.messages));
  7329.     }
  7330.  
  7331.       viewLine = currentMessage.getExpandCollapse (viewCounter, 0, this.pageURLToUse) + currentMessage.getViewEntry (this.currentMessageID);
  7332.       thread += this.getIndented (currentIndentLevel, viewLine);
  7333.  
  7334.       if (expandCollapseThread.doWeCollapse())
  7335.     {
  7336.       this.skipToNextSibling ();
  7337.       if (!this.messages.EOF)
  7338.         {
  7339.           firstMessageSortCode = this.getParentSortCode (String (dBase.getSortCodeField (this.messages)));
  7340.         }
  7341.     }
  7342.       else
  7343.     {
  7344.       if (!this.messages.EOF)
  7345.         {
  7346.           this.messages.MoveNext();
  7347.         }
  7348.     }
  7349.  
  7350.       delete currentMessage;
  7351.       delete expandCollapseThread;
  7352.     }
  7353.  
  7354.   delete dbase;
  7355.   return thread;
  7356. }
  7357.  
  7358. function getParentSortCode_vw_disc (sortcode)
  7359. {
  7360.   var parentSortCode = "";
  7361.   var lastSeparator = sortcode.lastIndexOf (".");
  7362.   if (-1 != lastSeparator)
  7363.     {
  7364.       parentSortCode = sortcode.substring (0, lastSeparator);
  7365.     }
  7366.  
  7367.   return parentSortCode;
  7368. }
  7369.  
  7370. function getViewFullThread_vw_disc ()
  7371. {
  7372.   if (this.messages.EOF)
  7373.     {
  7374.       return String (config.USERTEXT_VIEW_NoMessages).weak();
  7375.     }
  7376.   this.messages.MoveFirst();
  7377.  
  7378.   var lastIndentLevel;
  7379.   var currentIndentLevel;
  7380.   var viewLine;
  7381.   var firstMessageSortCode;
  7382.   var fullThread = "";
  7383.  
  7384.   lastIndentLevel = 0;
  7385.   var dBase = new ASPFDatabase ();
  7386.   firstMessageSortCode = String (dBase.getSortCodeField (this.messages));
  7387.  
  7388.   while (!this.messages.EOF)
  7389.     {
  7390.       var currentMessage = new ASPFMessage (this.messages);
  7391.  
  7392.       currentIndentLevel = this.getIndentLevel ();
  7393.       viewLine = currentMessage.getViewEntry (this.currentMessageID);
  7394.  
  7395.       fullThread += this.getIndented (currentIndentLevel, viewLine);
  7396.  
  7397.       if (!this.messages.EOF)
  7398.     {
  7399.       this.messages.MoveNext();
  7400.     }
  7401.  
  7402.       delete currentMessage;
  7403.     }
  7404.  
  7405.   delete dBase;
  7406.   return fullThread;
  7407. }
  7408.  
  7409. function getIndented_vw_disc (currentIndentLevel, viewText)
  7410. {
  7411.   var counter;
  7412.   var HTMLOutput;
  7413.   var tableWidth;
  7414.  
  7415.   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 ();
  7416.   for (counter = 0; counter < currentIndentLevel; counter++)
  7417.     {
  7418.       HTMLOutput += ASPFHTML.NBSP_multi (config.ADMINSETTING_ViewIndentResponseSpaces);
  7419.     }
  7420.   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 ();
  7421.  
  7422.   return HTMLOutput;
  7423. }
  7424.  
  7425. function getIndentLevel_vw_disc ()
  7426. {
  7427.   var parsedCode = new ASPFMessage (this.messages).sortCode;
  7428.   var foundAt = 1;
  7429.   var indentCounter = 0;
  7430.  
  7431.   while (foundAt > 0)
  7432.     {
  7433.       foundAt = String (parsedCode).search ("[\\.]");
  7434.       parsedCode = String (parsedCode).substr (foundAt + 1);
  7435.       indentCounter++;
  7436.     }
  7437.  
  7438.   delete parsedCode;
  7439.   return indentCounter;
  7440. }
  7441.  
  7442. function getSortcodeIndentLevel_vw_disc (sortCode)
  7443. {
  7444.   var parsedCode = sortCode;
  7445.   var foundAt = 1;
  7446.   var indentCounter = 0;
  7447.  
  7448.   while (foundAt > 0)
  7449.     {
  7450.       foundAt = String (parsedCode).search ("[^0-9]");
  7451.       parsedCode = String (parsedCode).substr (foundAt + 1);
  7452.       indentCounter++;
  7453.     }
  7454.   return indentCounter;
  7455. }
  7456.  
  7457. function skipToNextSibling_vw_disc ()
  7458. {
  7459.   var currentMessage = new ASPFMessage (this.messages);
  7460.   var currentSortCode = currentMessage.getSortCode ();
  7461.  
  7462.   this.messages.MoveNext();
  7463.   while ((!this.messages.EOF) && (String(currentSortCode).length < String(new ASPFMessage(this.messages).sortCode).length))
  7464.     {
  7465.       this.messages.MoveNext();
  7466.     }
  7467.  
  7468.   delete currentMessage;
  7469.   return;
  7470. }
  7471.  
  7472. function getDHTMLExpandCollapseCode_vw_disc ()
  7473. {
  7474.   var DHTMLCode = "";
  7475.  
  7476.   DHTMLCode += "\n<SCR" + "IPT LANGUAGE=\"Javascript\" RUNAT=\"client\">";
  7477.   DHTMLCode += "\nvar standardDOM;";
  7478.   DHTMLCode += "\nif (document.all)";
  7479.   DHTMLCode += "\n{";
  7480.   DHTMLCode += "\n\tstandardDOM = false;";
  7481.   DHTMLCode += "\n}";
  7482.   DHTMLCode += "\nelse";
  7483.   DHTMLCode += "\n{";
  7484.   DHTMLCode += "\n\tdocument.all = document.getElementById;";
  7485.   DHTMLCode += "\n\tstandardDOM = true;";
  7486.   DHTMLCode += "\n}\n";
  7487.   DHTMLCode += "\nfunction expandCollapseForumClick_disc (DOMEvent)";
  7488.   DHTMLCode += "\n{";
  7489.   DHTMLCode += "\n\tvar parentID;";
  7490.   DHTMLCode += "\n\tvar child;";
  7491.   DHTMLCode += "\n\tvar parentImage;";
  7492.   DHTMLCode += "\n\tif (standardDOM)";
  7493.   DHTMLCode += "\n\t{";
  7494.   DHTMLCode += "\n\t\tparentID = DOMEvent.target.id;";
  7495.   DHTMLCode += "\n\t}";
  7496.   DHTMLCode += "\n\telse";
  7497.   DHTMLCode += "\n\t{";
  7498.   DHTMLCode += "\n\t\tparentID = window.event.srcElement.id;";
  7499.   DHTMLCode += "\n\t}";
  7500.   DHTMLCode += "\n\tchild = document.all (\"Subthread-\" + parentID);";
  7501.   DHTMLCode += "\n\tif (child != null)";
  7502.   DHTMLCode += "\n\t{";
  7503.   DHTMLCode += "\n\t\tparentImage = document.all (parentID);";
  7504.   DHTMLCode += "\n\t\tif (child.style.display == \"none\")";
  7505.   DHTMLCode += "\n\t\t{";
  7506.   DHTMLCode += "\n\t\t\tchild.style.display = \"block\";";
  7507.   DHTMLCode += "\n\t\t\tparentImage.src = \"" + config.ADMINSETTING_CollapseImagePathname + "\";";
  7508.   DHTMLCode += "\n\t\t\tparentImage.alt = \"" + config.USERTEXT_VIEW_PopupCollapseLink + "\";";
  7509.   DHTMLCode += "\n\t\t}";
  7510.   DHTMLCode += "\n\t\telse";
  7511.   DHTMLCode += "\n\t\t{";
  7512.   DHTMLCode += "\n\t\t\tchild.style.display = \"none\";";
  7513.   DHTMLCode += "\n\t\t\tparentImage.src = \"" + config.ADMINSETTING_ExpandImagePathname + "\";";
  7514.   DHTMLCode += "\n\t\t\tparentImage.alt = \"" + config.USERTEXT_VIEW_PopupExpandLink + "\";";
  7515.   DHTMLCode += "\n\t\t}";
  7516.   DHTMLCode += "\n\t}";
  7517.   DHTMLCode += "\n\treturn true;";
  7518.   DHTMLCode += "\n}";
  7519.   DHTMLCode += "\n</SCR" + "IPT>";
  7520.  
  7521.   return DHTMLCode;
  7522. }
  7523.  
  7524. ASPFView.prototype.getMessageList = getMessageList_vw_disc;
  7525. ASPFView.prototype.setMessageList = setMessageList_vw_disc;
  7526. ASPFView.prototype.getCurrentMessageID = getCurrentMessageID_vw_disc;
  7527. ASPFView.prototype.setCurrentMessageID = setCurrentMessageID_vw_disc;
  7528.  
  7529. ASPFView.prototype.getView = getView_vw_disc;
  7530. ASPFView.prototype.getDHTMLView = getDHTMLView_vw_disc;
  7531. ASPFView.prototype.getDHTMLThread = getDHTMLThread_vw_disc;
  7532. ASPFView.prototype.getDHTMLChildren = getDHTMLChildren_vw_disc;
  7533. ASPFView.prototype.getViewThread = getViewThread_vw_disc;
  7534. ASPFView.prototype.getParentSortCode = getParentSortCode_vw_disc;
  7535. ASPFView.prototype.getViewFullThread = getViewFullThread_vw_disc;
  7536. ASPFView.prototype.getIndented = getIndented_vw_disc;
  7537. ASPFView.prototype.getIndentLevel = getIndentLevel_vw_disc;
  7538. ASPFView.prototype.getSortcodeIndentLevel = getSortcodeIndentLevel_vw_disc;
  7539. ASPFView.prototype.skipToNextSibling = skipToNextSibling_vw_disc;
  7540. ASPFView.prototype.getDHTMLExpandCollapseCode = getDHTMLExpandCollapseCode_vw_disc;
  7541. </SCRIPT>