Index: default/forum_view.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/forum_view.html,v
retrieving revision 1.39
retrieving revision 1.41
diff -b -u -r1.39 -r1.41
--- default/forum_view.html     18 Dec 2001 01:47:04 -0000      1.39
+++ default/forum_view.html     7 Jan 2002 20:56:30 -0000       1.41
@@ -166,7 +166,7 @@
              <img src="<%image_url%>/reply_post.gif" border="0" width="13" height="7" alt="Reply">
              <%GForum::Template::store_gvars(legend_reply => 1)%>
 <%  endif%>
-             <a href="gforum.cgi?post=<%post_id%>;sb=<%sb%>;so=<%so%>;forum_view=<%this_do%>;<%hidden_query%><%if post_depth and user_default_post_display == 1%>#<%post_id%><%endif%>">
+             <a href="gforum.cgi?post=<%post_id%>;sb=<%sb%>;so=<%so%>;forum_view=<%this_do%>;<%hidden_query%><%if current_user_default_post_display == 1%><%if post_depth%>#<%post_id%><%elsif current_user_jump_to_unread%>;page=unread#unread<%endif%><%endif%>">
                <%post_subject%>
              </a>
            <%/body_font%>
@@ -508,7 +508,7 @@
     <td align="right" valign="top">
 <%hidden_form%>
       <br><br>
-      <select name="forum" size="1" class="button">
+      <select name="jump" size="1" class="button">
 <%GForum::Forum::jump_list($forum_id)%>
       </select>
       <input type="submit" value="Jump to forum" class="submit">
Index: default/globals.txt
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/globals.txt,v
retrieving revision 1.23
retrieving revision 1.26
diff -b -u -r1.23 -r1.26
--- default/globals.txt 18 Dec 2001 01:47:04 -0000      1.23
+++ default/globals.txt 12 Jan 2002 20:53:53 -0000      1.26
@@ -1,6 +1,6 @@
 # This file is auto generated and contains a perl hash of
 # your template globals for 'default' template set.
-# Generated on: Tue Dec 11 17:46:10 2001
+# Generated on: Sat Jan 12 12:43:20 2002
 # vim: syn=perl

 {
@@ -9,11 +9,15 @@
        '/header_font' => '</b></font>',
        '/title_font' => '</b></font>',
        '/top_row_font' => '</b></font>',
+       'advanced_editor_background' => '#d9e4f2',
+       'advanced_editor_button' => '#E6F5D7',
+       'advanced_editor_font' => 'Verdana',
        'body_font' => '<font face="Verdana,Arial,Helvetica" size=2 color="black">',
        'body_table' => '<table border=0 width="100%" cellpadding=0 cellspacing=0><tr><td width=50><img src="<%image_url%>/clear_shim.gif" height=1 width=50></td><td width="100%"><table border=0 width="100%" cellpadding=0 cellspacing=0>',
        'body_tag' => '<body bgcolor="white" topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0>',
        'dark_beige' => '#A1A576',
        'dark_green' => '#256A19',
+       'editor_base_color' => '#E6F5D7',
        'even_color' => 'white',
        'header_font' => '<font face="Verdana,Arial,Helvetica" size=3 color="#003300"><b>',
        'header_row' => '<tr bgcolor="#E6F5D7">',
@@ -25,6 +29,8 @@
        'medium_green' => '#93B371',
        'odd_color' => '#d9e4f2',
        'registered_users' => 'sub { $DB->table(\'User\')->count }',
+       'scrollbar_arrow_color' => '#00ff33',
+       'scrollbar_base_color' => '#404040',
         'site_home' => 'Home',
        'site_title' => 'Gossamer Forum',
        'title_font' => '<font face="Verdana,Arial,Helvetica" size=4 color="#7a9f54"><b>',
Index: default/include_css.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/include_css.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -u -r1.3 -r1.4
--- default/include_css.html    28 Aug 2001 23:37:39 -0000      1.3
+++ default/include_css.html    10 Jan 2002 09:00:31 -0000      1.4
@@ -11,7 +11,7 @@
 --%>
 <style type="text/css" media="screen">
 <!--
-body { scrollbar-base-color: #404040; scrollbar-arrow-color: #00ff33; }
+body { scrollbar-base-color: <%scrollbar_base_color%>; scrollbar-arrow-color: <%scrollbar_arrow_color%>; }
 a.menu:link,a.menu:visited { font-size:11; color:black; text-decoration:none; font-face:'Verdana,Helvetica,Arial'; font-weight:600; }
 a.menu:hover { font-size:11; color:#256A19; text-decoration:underline; font-face:'Verdana,Helvetica,Arial'; font-weight:600; }
 .submit { background-color:#7a9f54; font-family: Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:white; font-weight:bold; }
Index: default/include_message_display.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/include_message_display.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -b -u -r1.9 -r1.10
--- default/include_message_display.html        14 Oct 2001 03:42:49 -0000      1.9
+++ default/include_message_display.html        7 Jan 2002 19:06:22 -0000       1.10
@@ -77,7 +77,7 @@
     </td>
     <td>
       <%body_font%>
-       <a href="gforum.cgi/<%messatt_filename_escaped%>?do=message_attachment;messatt_id=<%messatt_id%>;<%hidden_query%>">
+       <a href="gforum.cgi?do=message_attachment;messatt_id=<%messatt_id%>;<%hidden_query%>">
          <%messatt_filename%>
        </a>
        (<%GForum::Attachment::friendly_size($messatt_size)%>)
Index: default/include_message_html_common_write.html
===================================================================
RCS file: default/include_message_html_common_write.html
diff -N default/include_message_html_common_write.html
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ default/include_message_html_common_write.html      11 Jan 2002 23:18:57 -0000      1.1
@@ -0,0 +1,148 @@
+<%--
+
+File
+====
+include_message_common_write.html
+
+Description
+===========
+Every page involving writing a message uses this common page
+as an include for the actualy display.
+
+--%>
+<%if ie_version >= 6%><object id="dlg" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object><%endif%>
+<script language="Javascript">
+<!--
+
+var privateMessage = 1;
+
+<%include editor.js%>
+
+// -->
+</script>
+<%if attachment_error%>
+<font color="red">Your attachment was not uploaded successfully: <%attachment_error%><%endif%>
+<input type="hidden" name="temp_id" value="<%temp_id%>">
+<table border="0" cellspacing="0" cellpadding="4" width="100%">
+
+<%if ask_username%>
+  <tr>
+    <td align="right" width="125">
+      <%body_font%>
+       Recipient:<br> 
+      <%/body_font%>
+    </td>
+    <td align="left">
+      <input type="text" name="user_username"<%if user_username%> value="<%user_username%>"<%endif%> class="button" tabindex=1>
+    </td>
+  </tr>
+<%else%>
+  <tr>
+    <td align="right" width="125">
+      <%body_font%>
+       Recipient:<br>
+      <%/body_font%>
+    </td>
+    <td>
+      <input type="hidden" name="user" value="<%user_id%>">
+      <%body_font%>
+       <%nbsp user_username%>
+      <%/body_font%>
+    </td>
+  </tr>
+<%endif%>
+  <tr>
+    <td align="right">
+      <%body_font%>
+       Subject:
+      <%/body_font%>
+    </td>
+    <td>
+      <input type="text" name="msg_subject" size="60" value="<%msg_subject%>" class="button" tabindex=2>
+    </td>
+  </tr>
+  <tr>
+    <td align="right">
+      <%body_font%>
+       Message Style:
+      <%/body_font%>
+    </td>
+    <td>
+      <input type="hidden" name="msg_style" value="1">
+      <input type="hidden" name="advanced_editor" value="1">
+      <%body_font%>
+        <%GForum::language(FORUM_STYLE_MARKUP)%>
+      <%/body_font%>
+    </td>
+  </tr>
+    </td>
+  </tr>
+  <tr>
+    <td align="right" valign="top">
+      <%body_font%>
+       Post:<br>
+      <%/body_font%>
+<%include include_smilies_write.html%>
+    </td>
+    <td>
+      <input type="hidden" name="msg_body_html" value="<%msg_body%>">
+      <input type="hidden" name="msg_body" value="<%orig_msg_body%>">
+      <iframe name="editor_iframe" id="editor_iframe" width="100%" height="300" onLoad="initOuterIFrame()" style="visibility: hidden"></iframe>
+      <br><br><br>
+      <input type="submit" class="button" name="do=<%this_do%>;basic_editor=1;basic_editor_switch=1" value="Switch to Basic Editor">
+      <br>
+      <%body_font%>
+       &nbsp;<input type="checkbox" name="msg_append_signature" value="1"<%if msg_append_signature%> checked<%endif%> tabindex=5>
+       &nbsp;Append signature to message<br>
+      <%/body_font%>
+    </td>
+  </tr>
+
+<% --
+The following loops through attachments that are either going to be added with the message.
+    The following variables are available:
+       - att_id - the attachment ID of the post (in the temp attachment directory)
+       - att_filename - the filename of the attachment
+       - att_size - the size of the attachment in bytes. Use <%GForum::Attachment::friendly_size($att_size)%>
+                    to get a "friendly" size such as "66.3 KB" instead of "67890".
+       - att_content - the content type of the file (such as text/html for .html files). Use <%GForum::Attachment::icon($att_content, $att_filename)%> to get the web path to the appropriate icon.
+-- %>
+  <tr>
+    <td colspan="2">
+      <%list_table%>
+<%GForum::Utils::new_alternation(attachments)%>
+<%loop attachments%>
+       <tr bgcolor="<%GForum::Utils::alternation(attachments, $odd_color, $even_color)%>">
+         <td>
+           <img src="<%GForum::Attachment::icon($att_content, $att_filename)%>">
+         </td>
+         <td style="border-right:1px solid <%dark_beige%>">
+           <%body_font%>
+             <%att_filename%>
+           <%/body_font%>
+         </td>
+         <td style="border-right:1px solid <%dark_beige%>">
+           <%body_font%>
+             <%GForum::Attachment::friendly_size($att_size)%>
+           <%/body_font%>
+         </td>
+         <td align="right">
+           <input type="submit" name="do=message_attachment_delete;att_id=<%att_id%>;redo=<%this_do%>" value="Delete Attachment" class="button" tabindex=6>
+         </td>
+       </tr>
+<%endloop%>
+      </table>
+    </td>
+  </tr>
+<%if can_attach%>
+  <tr bgcolor="<%medium_beige%>">
+    <td colspan="2">
+      <%body_font%>
+       Attachment:
+        <input type="file" name="msg_attachment" class="button" tabindex=6>
+        <input type="submit" name="do=message_attachment_upload;redo=<%this_do%>" value="Upload attachment" class="button" tabindex=6>
+      <%/body_font%>
+    </td>
+  </tr>
+<%endif%>
+</table>
Index: default/include_post_common_write.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/include_post_common_write.html,v
retrieving revision 1.24
retrieving revision 1.27
diff -b -u -r1.24 -r1.27
--- default/include_post_common_write.html      16 Dec 2001 00:17:46 -0000      1.24
+++ default/include_post_common_write.html      10 Jan 2002 09:00:31 -0000      1.27
@@ -191,7 +191,7 @@
        <input type="button" class="button" name="markup_tag_email" tabindex=30 value="email" onClick="javascript: addTag(this.value); this.value = (this.value == 'email' ? '/email' : 'email');">
        <input type="button" class="button" name="markup_tag_url"   tabindex=30 value="url"   onClick="javascript: addTag(this.value); this.value = (this.value == 'url'   ? '/url'   : 'url');">
        <br>
-        <%if forum_style >= 1%>
+        <%if forum_style % 2 and is_ie and ie_version >= 5.5%>
         <br>
         <input type="submit" class="button" name="do=<%this_do%>;advanced_editor=1;advanced_editor_switch=1" value="Switch to Advanced Editor">
         <%endif%>
@@ -229,20 +229,20 @@
       <%list_table%>
 <%  endif%>
        <tr bgcolor="<%if odd%><%light_beige%><%else%><%even_color%><%endif%>">
-         <td style="border-right:1px solid <%dark_beige%>; border-top:1px solid <%darkbiege%>">
+         <td style="border-right:1px solid <%dark_beige%><%unless first%>; border-top:1px solid <%darkbiege%><%endif%>">
            <img src="<%GForum::Attachment::icon($att_content, $att_filename)%>">
          </td>
-         <td style="border-right:1px solid <%dark_beige%>; border-top:1px solid <%darkbiege%>">
+         <td style="border-right:1px solid <%dark_beige%><%unless first%>; border-top:1px solid <%darkbiege%><%endif%>">
            <%body_font%>
              <%att_filename%>
            <%/body_font%>
          </td>
-         <td style="border-right:1px solid <%dark_beige%>; border-top:1px solid <%darkbiege%>">
+         <td style="border-right:1px solid <%dark_beige%><%unless first%>; border-top:1px solid <%darkbiege%><%endif%>">
            <%body_font%>
              <%GForum::Attachment::friendly_size($att_size)%>
            <%/body_font%>
          </td>
-         <td style="border-top:1px solid <%darkbiege%>" align="right">
+         <td<%unless first%> style="border-top:1px solid <%darkbiege%>"<%endif%> align="right">
            <input type="submit" class="button" tabindex=12 name="do=post_attachment_delete;att_type=<%att_type%>;att_id=<%att_id%>;redo=<%this_do%>" value="Delete attachment">
          </td>
        </tr>
Index: default/include_post_display.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/include_post_display.html,v
retrieving revision 1.35
retrieving revision 1.36
diff -b -u -r1.35 -r1.36
--- default/include_post_display.html   16 Dec 2001 07:08:58 -0000      1.35
+++ default/include_post_display.html   6 Jan 2002 00:36:02 -0000       1.36
@@ -185,7 +185,7 @@
     </td>
     <td valign="top" style="border-top: 1px solid <%dark_beige%>">
       <%body_font%>
-       <a href="gforum.cgi<%unless is_iis%>/<%postatt_filename_escaped%><%endunless%>?do=post_attachment;postatt_id=<%postatt_id%>;<%hidden_query%>">
+       <a href="gforum.cgi?do=post_attachment;postatt_id=<%postatt_id%>;<%hidden_query%>">
          <img src="<%GForum::Attachment::icon($postatt_content, $postatt_filename)%>" border=0>
          <%postatt_filename%>
        </a>
Index: default/include_post_html_common_write.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/include_post_html_common_write.html,v
retrieving revision 1.6
retrieving revision 1.9
diff -b -u -r1.6 -r1.9
--- default/include_post_html_common_write.html 16 Dec 2001 00:17:46 -0000      1.6
+++ default/include_post_html_common_write.html 11 Jan 2002 23:18:57 -0000      1.9
@@ -12,75 +12,13 @@
 editor for writing markup posts.

 --%>
+<%if ie_version >= 6%><object id="dlg" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object><%endif%>
 <script language="Javascript">
 <!--

-var Faces = {
-    ':)'      : '<%image_url%>/smile.gif',
-    ';)'      : '<%image_url%>/wink.gif',
-    ':('      : '<%image_url%>/frown.gif',
-    ':P'      : '<%image_url%>/tongue.gif',
-    'cool'    : '<%image_url%>/cool.gif',
-    'blush'   : '<%image_url%>/blush.gif',
-    'angelic' : '<%image_url%>/angelic.gif',
-    'crazy'   : '<%image_url%>/crazy.gif',
-    'mad'     : '<%image_url%>/mad.gif',
-    'shocked' : '<%image_url%>/shocked.gif',
-    'laugh'   : '<%image_url%>/laugh.gif',
-    ':/'      : '<%image_url%>/unsure.gif',
-    ':|'      : '<%image_url%>/unimpressed.gif',
-    'sly'     : '<%image_url%>/sly.gif',
-    'pirate'  : '<%image_url%>/pirate.gif'
-};
-var Edit = false;
-var SInterval;
-function load_html () {
-    document.post.onsubmit = retrieve_html;
-    var url = window.location.protocol + '//' + window.location.hostname + window.location.pathname + '?<%hidden_query%>';
-    Edit = new iframe.Editor ({
-        debug      : 0,
-        base_url   : url,
-        image_url  : url + ';do=editor_image',
-        tb_hide    : ['Table'],
-        tb_delete  : ['Form', 'Positioning']
-    });
-    if ( document.post.post_message.value ) {
-        Edit.set_editor_html(document.post.post_message.value);
-    }
-    else {
-        Edit.set_editor_html('<HTML><body><\/body><\/html>');
-    }
-    Edit.init();
-    SInterval = setInterval("show_smilies()", 500);
-}
-function show_smilies () {
-    if ( Edit.initialized ) {
-        document.all.smilies.style.visibility = "visible";
-        clearInterval(SInterval)
-    }
-}
-function retrieve_html () {
-    document.post.post_message.value = Edit.get_editor_html();
-}
-
-function addTag (face) {
-    if ( !Edit.initialized || !Faces[face] ) return;
-    Edit.insert_html( '<img src="' + Faces[face] + '">' );
-    Edit.control.focus();
-}
-
-// This handles the tabing - if you change the post icon selection, the
-// tabIndex needs to be changed as well so that we don't have to tab through all
-// of the icons if going through the page with tab
-function updateTab (selected_val) {
-  var col = document.getElementsByName("post_icon");
-  for (i = 0; i < col.length; i++) {
-    if (selected_val == col[i].value)
-      col[i].tabIndex = 5;
-    else
-      col[i].tabIndex = 0;
-  }
-}
+var privateMessage = 0; // Needed for supporting the editor in private messages
+
+<%include editor.js%>

 // -->
 </script>
@@ -182,15 +120,13 @@
       <%body_font%>
        Post:<br>
       <%/body_font%>
-<%if forum_style_selected % 2%><%-- Only show the smilies if something with markup is set --%>
-<div id=smilies style="visibility: hidden">
 <%include include_smilies_write.html%>
-</div>
-<%endif%>
     </td>
     <td>
-      <input type="hidden" name="post_message" value="<%post_message%>">
-      <iframe src="gforum.cgi?<%hidden_query%>;do=editor_iframe" id="iframe" width="100%" height="300"></iframe><br>
+      <input type="hidden" name="post_message_html" value="<%post_message%>">
+      <input type="hidden" name="post_message" value="<%orig_post_message%>">
+      <iframe name="editor_iframe" id="editor_iframe" width="100%" height="300" onLoad="initOuterIFrame()" style="visibility: hidden"></iframe>
+      <br>
        <br><br>
         <input type="submit" class="button" name="do=<%this_do%>;basic_editor=1;basic_editor_switch=1" value="Switch to Basic Editor">
 <%if current_user_id%>
Index: default/language.txt
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/language.txt,v
retrieving revision 1.30
retrieving revision 1.33
diff -b -u -r1.30 -r1.33
--- default/language.txt        16 Dec 2001 21:29:58 -0000      1.30
+++ default/language.txt        12 Jan 2002 20:54:31 -0000      1.33
@@ -1,3 +1,8 @@
+# This file contains a perl hash of the default language variables for the
+# 'default' template set. You should not edit this file manually, but use the
+# language editor in the admin panel instead. Changes will be saved in the
+# "local" directory.
+# vim:syn=perl
 {
   'ACTION_BAD' => 'No such action \'%s\'',
   'ACTION_MUST_LOGIN' => 'Guests are not authorized to access that page. Please login as a user',
@@ -12,6 +17,20 @@
   'ATTACHMENT_SYSTEM_ERROR' => 'A system error occured while attempting to save your attachment: %s',
   'ATTACHMENT_TOO_LARGE' => 'The attachment exceeds the maximum attachment size (%s)',
   'CATEGORY_DOES_NOT_EXIST' => 'The category you attempted to access does not exist',
+       'DATE_DAY_1' => 'Sunday',
+       'DATE_DAY_2' => 'Monday',
+       'DATE_DAY_3' => 'Tuesday',
+       'DATE_DAY_4' => 'Wednesday',
+       'DATE_DAY_5' => 'Thursday',
+       'DATE_DAY_6' => 'Friday',
+       'DATE_DAY_7' => 'Saturday',
+       'DATE_DAY_SHORT_1' => 'Sun',
+       'DATE_DAY_SHORT_2' => 'Mon',
+       'DATE_DAY_SHORT_3' => 'Tue',
+       'DATE_DAY_SHORT_4' => 'Wed',
+       'DATE_DAY_SHORT_5' => 'Thu',
+       'DATE_DAY_SHORT_6' => 'Fri',
+       'DATE_DAY_SHORT_7' => 'Sat',
   'DATE_FORMAT' => '%mmm% %d%, %yyyy%, %h%:%MM% %tt%',
   'DATE_MONTH_1' => 'January',
   'DATE_MONTH_10' => 'October',
@@ -37,20 +56,6 @@
   'DATE_MONTH_SHORT_7' => 'Jul',
   'DATE_MONTH_SHORT_8' => 'Aug',
   'DATE_MONTH_SHORT_9' => 'Sep',
-  'DATE_DAY_1' => 'Sunday',
-  'DATE_DAY_2' => 'Monday',
-  'DATE_DAY_3' => 'Tuesday',
-  'DATE_DAY_4' => 'Wednesday',
-  'DATE_DAY_5' => 'Thursday',
-  'DATE_DAY_6' => 'Friday',
-  'DATE_DAY_7' => 'Saturday',
-  'DATE_DAY_SHORT_1' => 'Sun',
-  'DATE_DAY_SHORT_2' => 'Mon',
-  'DATE_DAY_SHORT_3' => 'Tue',
-  'DATE_DAY_SHORT_4' => 'Wed',
-  'DATE_DAY_SHORT_5' => 'Thu',
-  'DATE_DAY_SHORT_6' => 'Fri',
-  'DATE_DAY_SHORT_7' => 'Sat',
   'FILESIZE_BYTES' => 'B',
   'FILESIZE_KILOBYTES' => 'KB',
   'FILESIZE_MEGABYTES' => 'MB',
@@ -60,6 +65,7 @@
   'FORUM_STYLE_MARKUP' => 'Markup',
   'FORUM_STYLE_PLAIN' => 'Plain Text Only',
   'LOGIN_DISABLED' => 'Your account is not enabled',
+       'LOGIN_FAILED' => 'You could not be logged in. Perhaps you tried to log in with cookies, but cookies are disabled?',
   'LOGIN_INVALID_USERNAME_PASSWORD' => 'Invalid username/password combination entered',
   'LOGIN_NOT_VALIDATED' => 'Your signup has not been validated',
   'MESSAGE_DOES_NOT_EXIST' => 'The message you attempted to access does not exist',
@@ -82,10 +88,10 @@
   'POST_DELETED' => '<post deleted>',
   'POST_DOES_NOT_EXIST' => 'The post you attempted to access does not exist',
   'POST_EDIT_TIME_EXPIRED' => 'The edit/delete time for the post has expired',
-  'POST_REMOVE_NOT_MODERATOR' => 'Only moderators are permitted to completely remove posts',
   'POST_IS_DELETED' => 'The post you attempted to access has been deleted',
   'POST_LOCKED' => 'That thread has been locked',
   'POST_REGARDING' => 'Re: ',
+       'POST_REMOVE_NOT_MODERATOR' => 'Only moderators are permitted to completely remove posts',
   'PROFILE_INVALID_DATA' => 'Invalid data for the %s field',
   'PROFILE_PASSWORDS_DONT_MATCH' => 'The passwords you entered do not match',
   'SEARCH_NO_FORUMS' => 'You did not select any forums to search, or there are no forums available',
Index: default/message.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/message.html,v
retrieving revision 1.15
retrieving revision 1.16
diff -b -u -r1.15 -r1.16
--- default/message.html        18 Dec 2001 01:47:04 -0000      1.15
+++ default/message.html        11 Jan 2002 23:18:57 -0000      1.16
@@ -17,6 +17,13 @@
 <%include include_css.html%>
 </head>

+<%-- Figure out if we're going to use the advanced editor --%>
+<%if advanced_editor and is_ie and ie_version >= 5.5%>
+<%set user_ae = 1%>
+<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5.5%>
+<%set user_ae = 1%>
+<%endif%>
+
 <%body_tag%>
 <center>
 <%include include_header.html%>
@@ -73,7 +80,11 @@
        </tr>
        <tr>
          <td>
+<%if user_ae%>
+<%include include_message_html_common_write.html%>
+<%else%>
 <%include include_message_common_write.html%>
+<%endif%>
 <script language="JavaScript">
 <!--
 <%if ask_username%>
Index: default/message_reply_write.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/message_reply_write.html,v
retrieving revision 1.20
retrieving revision 1.22
diff -b -u -r1.20 -r1.22
--- default/message_reply_write.html    18 Dec 2001 01:47:04 -0000      1.20
+++ default/message_reply_write.html    11 Jan 2002 23:18:57 -0000      1.22
@@ -16,6 +16,13 @@
 <%if spellcheck%><%spellcheck_head%><%endif%>
 </head>

+<%-- Figure out if we're going to use the advanced editor --%>
+<%if advanced_editor and is_ie and ie_version >= 5.5%>
+<%set user_ae = 1%>
+<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5.5%>
+<%set user_ae = 1%>
+<%endif%>
+
 <%body_tag%>
 <%include include_header.html%>
 <center>
@@ -59,11 +66,12 @@
       <%list_table%>
        <%top_row%>
          <td align="right" width="100" valign="top">
+            <img src="<%image_url%>/clear_shim.gif" width=100 height=1><br>
            <%top_row_font%>
              Replying to:
            <%/top_row_font%>
          </td>
-         <td align="left">
+         <td align="left" width="100%">
            <%top_row_font%>
              "<%parent_msg_subject%>" by
              <a href="gforum.cgi?username=<%GT::CGI::escape($user_username)%>;<%hidden_query%>"><font color="white"><%nbsp user_username%></font></a>
@@ -71,7 +79,7 @@
          </td>
        </tr>
        <tr bgcolor="<%light_beige%>">
-         <td align="right" valign="top" width="100">
+         <td align="right" valign="top">
            <%body_font%>
              <b>Original Message:</b>
            <%/body_font%>
@@ -88,12 +96,11 @@
            <%hidden_form%>
            <input type="hidden" name="user" value="<%user_id%>">
            <input type="hidden" name="reply_to" value="<%parent_msg_id%>">
+<%if user_ae%>
+<%include include_message_html_common_write.html%>
+<%else%>
 <%include include_message_common_write.html%>
-<script language="JavaScript">
-<!--
-document.message.msg_body.focus();
--->
-</script>
+<%endif%>
          </td>
        </tr>
        <tr bgcolor="<%light_green%>">
Index: default/post_already_posted.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_already_posted.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -r1.4 -r1.5
--- default/post_already_posted.html    16 Dec 2001 00:17:46 -0000      1.4
+++ default/post_already_posted.html    7 Jan 2002 20:56:30 -0000       1.5
@@ -46,7 +46,7 @@
     <td colspan="2">
       <br>
 <%hidden_form%>
-      <select class="button" name=forum size=1>
+      <select class="button" name=jump size=1>
 <%GForum::Forum::jump_list($forum_id)%>
       </select>
       &nbsp;
Index: default/post_delete_confirm.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_delete_confirm.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -b -u -r1.11 -r1.12
--- default/post_delete_confirm.html    18 Dec 2001 19:49:29 -0000      1.11
+++ default/post_delete_confirm.html    4 Jan 2002 19:32:25 -0000       1.12
@@ -38,7 +38,6 @@
   <tr>
     <td colspan=2><br>
       <%hidden_form%>
-      <input type="hidden" name="post_id" value="<%post_id%>">
       <%body_font%>
        You have chosen to delete the following post:<br>
        <%include include_post_display.html%>
Index: default/post_detached.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_detached.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -u -r1.3 -r1.4
--- default/post_detached.html  16 Dec 2001 00:17:46 -0000      1.3
+++ default/post_detached.html  7 Jan 2002 20:56:30 -0000       1.4
@@ -52,7 +52,7 @@
     <td colspan="2">
       <br>
 <%hidden_form%>
-      <select class="button" name=forum size=1>
+      <select class="button" name=jump size=1>
 <%GForum::Forum::jump_list($old_forum_id)%>
       </select>
       &nbsp;
Index: default/post_edit.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_edit.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -b -u -r1.16 -r1.17
--- default/post_edit.html      17 Dec 2001 04:40:30 -0000      1.16
+++ default/post_edit.html      10 Jan 2002 09:00:31 -0000      1.17
@@ -44,9 +44,9 @@
     <td colspan="2">
       <%hidden_form%>
       <input type="hidden" name="post" value="<%post_id%>">
-<%if advanced_editor and is_ie and ie_version >= 5%>
+<%if advanced_editor and is_ie and ie_version >= 5.5%>
 <%include include_post_html_common_write.html%>
-<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5%>
+<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5.5%>
 <%include include_post_html_common_write.html%>
 <%else%>
 <%include include_post_common_write.html%>
Index: default/post_moved.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_moved.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -b -u -r1.9 -r1.10
--- default/post_moved.html     17 Dec 2001 00:38:48 -0000      1.9
+++ default/post_moved.html     7 Jan 2002 20:56:30 -0000       1.10
@@ -48,7 +48,7 @@
     <td colspan="2">
       <br>
 <%hidden_form%>
-      <select class="button" name=forum size=1>
+      <select class="button" name=jump size=1>
 <%GForum::Forum::jump_list($old_forum_id)%>
       </select>
       &nbsp;
Index: default/post_post.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_post.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -b -u -r1.16 -r1.17
--- default/post_post.html      16 Dec 2001 00:17:46 -0000      1.16
+++ default/post_post.html      7 Jan 2002 20:56:30 -0000       1.17
@@ -50,7 +50,7 @@
     <td colspan="2">
       <br>
 <%hidden_form%>
-      <select class="button" name=forum size=1>
+      <select class="button" name=jump size=1>
 <%GForum::Forum::jump_list($forum_id)%>
       </select>
       &nbsp;
Index: default/post_reply_post.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_reply_post.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -b -u -r1.16 -r1.17
--- default/post_reply_post.html        16 Dec 2001 00:17:46 -0000      1.16
+++ default/post_reply_post.html        7 Jan 2002 20:56:30 -0000       1.17
@@ -50,7 +50,7 @@
     <td colspan="2">
       <br>
       <%hidden_form%>
-      <select class="button" name=forum size=1>
+      <select class="button" name=jump size=1>
 <%GForum::Forum::jump_list($forum_id)%>
       </select>
       <input class="submit" type=submit value="Jump to forum">
Index: default/post_reply_write.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_reply_write.html,v
retrieving revision 1.24
retrieving revision 1.25
diff -b -u -r1.24 -r1.25
--- default/post_reply_write.html       17 Dec 2001 04:40:30 -0000      1.24
+++ default/post_reply_write.html       10 Jan 2002 09:00:31 -0000      1.25
@@ -52,9 +52,9 @@
   </tr>
   <tr bgcolor="<%odd_color%>">
     <td colspan="2">
-<%if advanced_editor and is_ie and ie_version >= 5%>
+<%if advanced_editor and is_ie and ie_version >= 5.5%>
 <%include include_post_html_common_write.html%>
-<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5%>
+<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5.5%>
 <%include include_post_html_common_write.html%>
 <%else%>
 <%include include_post_common_write.html%>
Index: default/post_view_flat.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_view_flat.html,v
retrieving revision 1.21
retrieving revision 1.23
diff -b -u -r1.21 -r1.23
--- default/post_view_flat.html 16 Dec 2001 00:17:46 -0000      1.21
+++ default/post_view_flat.html 7 Jan 2002 20:56:30 -0000       1.23
@@ -89,6 +89,9 @@
 <%  if last%>
        <a name="last"></a>
 <%  endif%>
+<%  if first_new%>
+        <a name="unread"></a>
+<%  endif%>
 <%  include include_post_display.html%>
        <br>
       <%/body_font%>
@@ -133,7 +136,7 @@
        <tr bgcolor="<%light_green%>">
          <td align="right">
 <%hidden_form%>
-           <select class="button" name="forum" size="1">
+           <select class="button" name="jump" size="1">
 <%GForum::Forum::jump_list($forum_id)%>
            </select>
            &nbsp;
Index: default/post_view_threaded.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_view_threaded.html,v
retrieving revision 1.22
retrieving revision 1.23
diff -b -u -r1.22 -r1.23
--- default/post_view_threaded.html     16 Dec 2001 00:17:46 -0000      1.22
+++ default/post_view_threaded.html     7 Jan 2002 20:56:30 -0000       1.23
@@ -127,7 +127,7 @@
        <tr bgcolor="<%light_green%>">
          <td align="right">
 <%hidden_form%>
-           <select class="button" name="forum" size="1">
+           <select class="button" name="jump" size="1">
 <%GForum::Forum::jump_list($forum_id)%>
            </select>
            &nbsp;
Index: default/post_write.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/post_write.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -b -u -r1.19 -r1.20
--- default/post_write.html     16 Dec 2001 00:17:46 -0000      1.19
+++ default/post_write.html     10 Jan 2002 09:00:31 -0000      1.20
@@ -47,9 +47,9 @@
       <input type="hidden" name="forum" value="<%forum_id%>">
       <br>
       <%body_font%>
-<%if advanced_editor and is_ie and ie_version >= 5%>
+<%if advanced_editor and is_ie and ie_version >= 5.5%>
 <%include include_post_html_common_write.html%>
-<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5%>
+<%elsif current_user_advanced_editor and not basic_editor and is_ie and ie_version >= 5.5%>
 <%include include_post_html_common_write.html%>
 <%else%>
 <%include include_post_common_write.html%>
Index: default/user_profile_display.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/user_profile_display.html,v
retrieving revision 1.19
retrieving revision 1.22
diff -b -u -r1.19 -r1.22
--- default/user_profile_display.html   18 Dec 2001 01:47:04 -0000      1.19
+++ default/user_profile_display.html   11 Jan 2002 10:30:10 -0000      1.22
@@ -129,6 +129,17 @@
          </td>
        </tr>
         <tr>
+         <td align=right>
+           <%body_font%>In flat view, when viewing thread:<%/body_font%>
+         </td>
+         <td>
+           <select class="button" name=user_jump_to_unread size=1>
+             <option value=1<%if user_jump_to_unread%> selected<%endif%>>Jump to first unread post</option>
+             <option value=0<%ifnot user_jump_to_unread%> selected<%endifnot%>>View root post</option>
+           </select>
+         </td>
+       </tr>
+        <tr>
           <td align=right valign=top>
             <%body_font%>Post writer/editor:<%/body_font%>
           </td>
@@ -137,7 +148,7 @@
               <option value=0<%if user_advanced_editor = 0%> selected<%endif%>>Basic Editor</option>
               <option value=1<%if user_advanced_editor = 1%> selected<%endif%>>Advanced Editor</option>
             </select><br>
-            <%body_font%><small><i><u>Note</u>: The advanced editor required Internet Explorer version 5.0 or greater</i></small><%/body_font%>
+            <%body_font%><small><i><u>Note</u>: The advanced editor required Internet Explorer version 5.5 or greater</i></small><%/body_font%>
           </td>
         </tr>
         <tr>
Index: default/validation.eml
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default/validation.eml,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -r1.2 -r1.3
--- default/validation.eml      8 Oct 2001 02:03:30 -0000       1.2
+++ default/validation.eml      12 Jan 2002 20:05:57 -0000      1.3
@@ -6,7 +6,7 @@

 This e-mail has been sent to confirm that this is a valid e-mail address.  You will be unable to login until you have visited the following URL:

-<%cgi_root_url%>/gforum.cgi?do=user_validate;validate=<%validate_code%>
+<%cgi_root_url%>/gforum.cgi?do=user_validate&validate=<%validate_code%>

 Your real e-mail address will only be used to send you notification of replies
 and forum archives (if you request them). Your real e-mail address will not be
Index: default_top/include_post_display.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/default_top/include_post_display.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -u -r1.6 -r1.7
--- default_top/include_post_display.html       16 Dec 2001 07:08:58 -0000      1.6
+++ default_top/include_post_display.html       6 Jan 2002 00:36:02 -0000       1.7
@@ -203,7 +203,7 @@
     </td>
     <td valign="top" width="90%" colspan="3" style="border-top: 1px solid <%dark_beige%>">
       <%body_font%>
-      <a href="gforum.cgi<%unless is_iis%>/<%postatt_filename_escaped%><%endunless%>?do=post_attachment;postatt_id=<%postatt_id%>;<%hidden_query%>">
+      <a href="gforum.cgi?do=post_attachment;postatt_id=<%postatt_id%>;<%hidden_query%>">
          <img src="<%GForum::Attachment::icon($postatt_content, $postatt_filename)%>" border=0>
          <%postatt_filename%>
        </a>
Index: admin/home_right.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/home_right.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -u -r1.8 -r1.9
--- admin/home_right.html       24 Nov 2001 06:50:36 -0000      1.8
+++ admin/home_right.html       4 Jan 2002 22:19:38 -0000       1.9
@@ -25,7 +25,7 @@
 <p><font face="Tahoma,Arial,Helvetica" size="2"><font color="red"><b>You are currently using a 30-day evaluation^M
 version of Gossamer Forum. </b></font> Your forum administration panel will expire in^M
 <%if gforum_expiry_days <= 5%><font color=red><%endif%>^M
-<%if gforum_expiry_days%><%gforum_expiry_days%> day<%unless gforum_expiry_days = 1%>s<%endunless%>^M
+<%if gforum_expiry_days%><%gforum_expiry_days%> day<%unless gforum_expiry_days = 1%>s<%endunless%>.^M
 <%elsif gforum_expiry_hours%><%gforum_expiry_hours%> hour<%unless gforum_expiry_hours = 1%>s<%endunless%>.^M
 <%elsif gforum_expiry_minutes%><%gforum_expiry_minutes%> minute<%unless gforum_expiry_minutes = 1%>s<%endunless%>.^M
 <%elsif gforum_expiry_seconds%><%gforum_expiry_seconds%> second<%unless gforum_expiry_seconds = 1%>s<%endunless%>.^M
Index: admin/markup_tags_add.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/markup_tags_add.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -u -r1.8 -r1.9
--- admin/markup_tags_add.html  9 Nov 2001 20:56:04 -0000       1.8
+++ admin/markup_tags_add.html  6 Jan 2002 02:25:14 -0000       1.9
@@ -5,7 +5,7 @@
 <%      set error_message_2 = $markup_tag%>
 <%      set error_message_3 = "': a tag cannot start with '.'"%>
 <%    else%>
-<%      GForum::Markup::add_tag(tag => $markup_tag, html => $markup_html, closing => $closing_markup_html, markup_type => $markup_type)%>
+<%      GForum::Markup::add_tag(tag => $markup_tag, html => $markup_html, closing => $closing_markup_html, markup_type => $markup_type, clear_newlines => $clear_newlines)%>
 <%      if added_closing%>
 <%        set success_message   = "Markup tags '"%>
 <%        set success_message_2 = $markup_tag%>
@@ -63,7 +63,7 @@
        <tr>
          <td><%font_tag%>Markup Type:<br><small>(Used for sorting)</small></font></td>
          <td>
-           <input type=text name=markup_type<%if error_message and markup_type%>value="<%markup_type%>"<%endif%>><br>
+           <input type=text name=markup_type<%if error_message and markup_type%> value="<%markup_type%>"<%endif%>><br>
          <%font_tag%><small>Existing types:<%GForum::Markup::list_types%>
 <%loop types%>
            <a href="javascript: document.markup_add.markup_type.value = '<%escape_js type%>'; void(0)"><%type%></a> (<%type_num%>)
@@ -72,6 +72,10 @@
            </small></font>
          </td>
        </tr>
+        <tr>
+          <td><%font_tag%>Clear spaces:<br><small>(Clears extra space before and after the markup tag)</small></font></td>
+          <td><input type=checkbox name=clear_newlines<%if error_message and clear_newlines%> checked<%endif%>></td>
+        </tr>
        <tr>
          <td align=center colspan=2><%font_tag%><input type=submit value="Add Tag"></font></td>
        </tr>
Index: admin/markup_tags_list.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/markup_tags_list.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -b -u -r1.7 -r1.8
--- admin/markup_tags_list.html 18 Dec 2001 21:27:58 -0000      1.7
+++ admin/markup_tags_list.html 6 Jan 2002 02:25:14 -0000       1.8
@@ -33,6 +33,10 @@
          <td valign=top><%font_tag%>Type:</font></td>
          <td valign=top><%font_tag%><%type%></font></td>
        </tr>
+        <tr>
+          <td valign=top><%font_tag%>Clear spaces:</font></td>
+          <td valign=top><%font_tag%><%if clear_newlines%>Yes<%else%>No<%endif%></font></td>
+        </tr>
        <tr>
          <td valign=top><%font_tag%>Sample:</font></td>
          <td valign=top><%font_tag%><%html%><%if has_closing%><%sample_text%><%closing%><%endif%></font></td>
Index: admin/markup_tags_modify_2.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/markup_tags_modify_2.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -b -u -r1.7 -r1.8
--- admin/markup_tags_modify_2.html     7 Dec 2001 23:42:27 -0000       1.7
+++ admin/markup_tags_modify_2.html     6 Jan 2002 02:25:14 -0000       1.8
@@ -1,7 +1,7 @@
 <%ifnot markup_tag%><%set error_message = "No markup tag selected"%><%include markup_tags_modify.html%><%endparse%><%endifnot%>
 <% -- The line above takes us back to the tag selection page with an error if no tag was selected -- %>
 <%if markup_tag and modify_tag%>
-  <%GForum::Markup::modify_tag(tag => $markup_tag, html => $markup_html, closing => $closing_markup_html, markup_type => $markup_type)%>
+  <%GForum::Markup::modify_tag(tag => $markup_tag, html => $markup_html, closing => $closing_markup_html, markup_type => $markup_type, clear_newlines => $clear_newlines)%>
   <%if has_closing%>
     <%set success_message   = "Changes to tags '["%>
     <%set success_message_2 = $markup_tag%>
@@ -77,6 +77,10 @@
            </small></font>
          </td>
        </tr>
+        <tr>
+          <td><%font_tag%>Clear spaces:<br><small>(Clears extra spaces immediately before and after the markup tag)</small></font></td>
+          <td><input type=checkbox name=clear_newlines<%if clear_newlines%> checked<%endif%>></td>
+        </tr>
        <tr>
          <td align=center colspan=2><%font_tag%><input type=submit value="Modify Tag"></font></td>
        </tr>
Index: admin/tools_nav.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/tools_nav.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -r1.4 -r1.5
--- admin/tools_nav.html        9 Nov 2001 20:56:04 -0000       1.4
+++ admin/tools_nav.html        5 Jan 2002 21:55:48 -0000       1.5
@@ -25,6 +25,7 @@
       &nbsp; <a href="db.cgi?db=Forum;do=editor_table_form">Forum</a><br>
       &nbsp; <a href="db.cgi?db=Post;do=editor_table_form">Post</a><br>
       &nbsp; <a href="db.cgi?db=Message;do=editor_table_form">Message</a><br>
+      &nbsp; <a href="db.cgi?db=SentMessage;do=editor_table_form">SentMessage</a><br>
       &nbsp; <a href="db.cgi?db=Grouping;do=editor_table_form">Grouping</a><br>
       &nbsp; <br>
       &nbsp; <a href="admin.cgi?do=page;page=tools_reindex.stream.html">Reindex</a><br>
Index: admin/help/help_email.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/help/help_email.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -r1.2 -r1.3
--- admin/help/help_email.html  19 Oct 2001 20:07:29 -0000      1.2
+++ admin/help/help_email.html  10 Jan 2002 09:02:19 -0000      1.3
@@ -2,7 +2,7 @@

 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
-<title>Gossamer Forum Help: Email</title>
+<title>Gossamer Forum Help: Markup</title>^M
 </head>

 <body>
@@ -20,99 +20,55 @@
 </TABLE>
 <TABLE width=100% cellpadding=20>
 <TR><TD>
-    <p><u><font face="Tahoma, Arial, Helvetica" size="4">User Templates</font></u></p>
+    <p><u><font size="4" face="Tahoma,Arial,Helvetica">Mass Mail</font></u></p>^M
     <blockquote>
-      <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking &quot;User
-      Templates&quot; brings up a menu allowing you to view and modify all of
-      your database's templates.</font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Select
-      a template set from the &quot;Currently working on template set&quot;
-      drop-down menu and click the &#8220;Change&#8221; button.<span style="mso-spacerun: yes">&nbsp;
-      </span>If you want changes to your templates to be visible when you
-      rebuild your directory, you should modify the template set selected in the
-      &#8220;default_template_set&#8221; field in the &quot;Default Options&#8221; section
-      of the &quot;Setup&#8221; menu.&nbsp;</font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Select
-      a specific template from the &quot;Available templates&quot; drop-down
-      menu.&nbsp; Click &#8220;Load&#8221; to see the template displayed in the main
-      text area in the centre of the page.</font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">You
-      have the option of viewing and editing the template in an HTML editor
-      (click the link below the main text area to switch between the HTML editor
-      and the plain text editor).&nbsp; Note that certain tags may not be
-      accurately transferred from the plain text editor to the HTML editor.&nbsp;
-      Additionally, the HTML editor only functions on Microsoft IE browsers.</font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">The
-      size of the main text area can also be edited (enter values for the
-      columns and rows in the &#8220;Resize Textarea&#8221; fields).<span style="mso-spacerun: yes">&nbsp;</span></font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Insert
-      changes to the template in the main text area.<span style="mso-spacerun: yes">&nbsp;</span><br style="mso-special-character: line-break">
-      <br style="mso-special-character: line-break">
-      Click &#8220;Save&#8221; to confirm your changes to the template (you can alter
-      the name of the template in the field beside the &#8220;Save&#8221; button).<span style="mso-spacerun: yes">&nbsp;</span></font></p>
-    </blockquote>
+      <p><font size="2" face="Tahoma, Arial, Helvetica">Gossamer Forum provides you with a Mass Mailer, allowing you to send mail to all users or to select groups.  Detailed search forms allow you to refine your mailings' recipients. The Mass Mail options allow you to write and send email to whichever users you choose.  Mass mails can be composed using "All Users" or "Selected Users" options.<br><br>^M

-<p><u><font face="Tahoma, Arial, Helvetica" size="4">Email Templates</font></u></p>
-    <blockquote>
-      <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking "Email Templates" brings up a menu allowing you to edit the templates from that will be used to build emails automatically sent to your forum's users.</font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Select the template set you wish to modify from the first drop-down menu and click "Change".  Next, select the specific template you wish to modify from the drop-down menu (see below for descriptions of these templates) and click "Load".<span style="mso-spacerun: yes">&nbsp;
-      </span>The email template will be displayed in the "To", "Subject", "From" and "E-mail body" fields.  Clicking the "Show Extra Headers" button opens a field allowing extra headers to be added to the template or modified.  Make changes to the text and tags included in the desired fields.  You can save the template under a different name by entering one in the &#8220;Save template as:&#8221; field and clicking the &#8220;Save&#8221; button, or resize the template&#8217;s textarea by entering values in the row and column fields and clicking the &#8220;Change&#8221; button.&nbsp;</font></p>
-      <span style="mso-spacerun: yes">&nbsp;</span></font></p>
-    </blockquote>
+To personalize mailings being sent to more than one recipient, you can insert any of the fields in the Users Table into the mailing by using tags.  For example: typing &lt;%user_username%&gt; or &lt;%user_email%&gt; in the body of the mailing will insert each user's username or email address into their individual copy of the mailing.  Ensure that the field actually does exist in the database and that you've properly copied the spelling and casing, or an unknown tag error will appear.<br><br>^M
+^M
+To send an email, fill in the relevant fields (Name, Email, Subject, Message Format, Message) and click the "Send Emails" button.  You will be brought to the "View Mailings" menu, which displays all current and recently completed mailings.  To send the email you just created, click the "Start Mailing" link next to it.  Click the "Details" link to review the recipients and content of the email.<br><br>^M
+^M
+Click the "Cancel mailing" link if you wish to cancel the email.  You will be presented with the option of either confirming or aborting the cancellation of the mailing, as well as the details of the mailing. You can also delete all completed mailings and cancel/delete all current mailings from the "View Mailings" menu by clicking on the appropriate links at the bottom of the menu.  You will be prompted to either confirm or abort all deletions and cancellations.<br><br>^M

+You also have the option of creating, editing and loading custom-made email templates from the Mass Mail menus.  To create an email template, fill in the relevant fields as you would a regular email, but don't click the "Send Emails" button.  Ensure that the "Template" drop-down menu reads "New Template", and click the "Save" button just below it.  You will be prompted to give your new template a name.  After doing so, you will be returned to the appropriate Mass Mail menu, with the name of your new template displayed in the "Template" drop-down menu. ^M
+To load a pre-existing email template, select the template you want from the "Template" drop-down menu and click the "Load" button.<br><br> ^M

-    <p class="Directions">&nbsp;</p>
-    <p class="Directions"><u><font face="Tahoma, Arial, Helvetica" size="4">Language
-    Variables</font></u></p>
+You can edit a template by loading it, editing its fields and clicking the "Save" button, or you can create a new, separate template by clicking "Save as~E" after making your changes. ^M
+You can delete a template by clicking "Delete" after loading it.  ^M
+^M
+         </font></p>^M
+    </blockquote>^M
+    <ul>^M
+      <li><b><u><font size="2" face="Tahoma, Arial, Helvetica">All Users</font></u></b></li>^M
+    </ul>^M
     <blockquote>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Clicking
-      &quot;Language Variables&quot; displays a menu allowing you to view and
-      modify the text that will be displayed to your database's users in
-      prompts, warnings and error messages.</font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Select
-      a template set from the drop-down menu.<span style="mso-spacerun: yes">&nbsp;
-      </span>If you want changes to your language settings to be visible when
-      you rebuild your directory, you should modify the template set selected in
-      the &#8220;default_template_set&#8221; option in the &quot;Default Options&#8221;
-      section of the &quot;Setup&#8221; menu.<br style="mso-special-character: line-break">
-      <br style="mso-special-character: line-break">
-      <span style="mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-CA; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">Click
-      on a language category (ACTION, CATEGORY, LOGIN, etc.) to bring up a list
-      of all messages in that category.</span></font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Re-type
-      the message in the &#8220;Description&#8221; field in the language you want, and
-      click the &#8220;Save Changes&#8221; button.<span style="mso-spacerun: yes">&nbsp;
-      </span>Changes to the messages will be applied throughout the program
-      wherever the corresponding language code (displayed to the left of the
-      &#8220;Description&#8221; field) is found.<span style="mso-spacerun: yes">&nbsp;</span></font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">You
-      can also add or delete codes and descriptions in the User Language menu.<span style="mso-spacerun: yes">&nbsp;
-      </span>Enter new codes and descriptions in the blank fields at the bottom
-      of the page, or check the &#8220;Delete&#8221; boxes beside the messages and click
-      the &#8220;Save Changes&#8221; button.</font></p>
+      <p><font size="2" face="Tahoma, Arial, Helvetica">Clicking "All Users" allows you to send email to all users who have agreed to accept email from your database.  You can see the complete list of these users by clicking the link displaying the number of email recipients at the top of the email composition form. </font></p>^M
     </blockquote>
-    <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">&nbsp;</font></p>
-    <p class="Directions"><u><font face="Tahoma, Arial, Helvetica" size="4">Global
-    Variables</font></u></p>
+    <ul>^M
+      <li><b><u><font size="2" face="Tahoma, Arial, Helvetica">Selected Users</font></u></b></li>^M
+    </ul>^M
     <blockquote>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Clicking
-      &quot;Global Variables&quot; displays a menu allowing you to view and edit
-      your databases' globals.&nbsp; Globals are HTML tags that can be used in
-      all templates.</font></p>
-      <p class="Directions"><font face="Tahoma, Arial, Helvetica" size="2">Select
-      a template set from the first drop-down menu.<span style="mso-spacerun: yes">&nbsp;
-      </span>If you want changes to your globals to be visible when you rebuild
-      your directory, you should modify the template set selected in the
-      &#8220;default_template_set&#8221; option in the &quot;Default Options&#8221; section
-      of the &quot;Setup&#8221; menu.&nbsp; Make changes to the global in the
-      &#8220;Description&#8221; field, and click the &#8220;Save Changes&#8221; button.</font></p>
-      <p class="Directions"><font size="2"><font face="Tahoma, Arial, Helvetica">To
-      create a new global, enter it&#8217;s name in the Code field.&nbsp; </font><span style="mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-CA; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"><font face="Tahoma, Arial, Helvetica">Enter
-      the new global&#8217;s content in the Description field at the bottom of the
-      page (globals can be written in HTML or regular text), and click the
-      &#8220;Save Changes&#8221; button</font></span></font><span style="font-size: 12pt; mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-CA; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">.</span></p>
+      <p><font size="2" face="Tahoma, Arial, Helvetica">Clicking "Selected Users" allows you to send email to users who fit the results of a search.  Enter search terms in the form provided, and click the "Search For Users" button.  You will be brought to the email composition form.  To confirm that you have selected the users you wish to email, click the link displaying the number of email recipients at the top of the email composition form.</font></p>^M
     </blockquote>

+    <p><u><font size="4" face="Tahoma,Arial,Helvetica">Current Mailings: View</font></u></p>^M
+    ^M
+    <blockquote>^M
+      <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking "View" displays the "View Mailings" menu, which displays current and recently completed mailings, and allows you to manage them in several ways:<br><br>^M
+^M
+Click the "Start Mailing" link next to an unsent mailing to send it. <br><br>^M
+^M
+Click the "Details" link next to a mailing to review its recipients and content. <br><br>^M
+^M
+Click the "Cancel mailing" link next to an unsent mailing if you wish to cancel the mailing.  You will be presented with the option of either confirming or aborting the cancellation of the mailing, as well as the details of the mailing. <br><br>^M
+^M
+Click the "Delete mailing" link next to a completed mailing if you wish to permanently delete it from the "View Mailings" menu.<br><br>^M
+^M
+You can also delete all completed mailings and cancel/delete all current mailings from the "View Mailings" menu by clicking on the appropriate links at the bottom of the menu.  You will be prompted to either confirm or abort all deletions and cancellations.^M
+</font></p>^M
+    </blockquote>^M
+    ^M
+^M
 </TD>
 </TR>
 </TABLE>
Index: admin/help/help_forums.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/help/help_forums.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -r1.2 -r1.3
--- admin/help/help_forums.html 19 Oct 2001 20:07:29 -0000      1.2
+++ admin/help/help_forums.html 10 Jan 2002 09:02:19 -0000      1.3
@@ -22,45 +22,27 @@
 <TR><TD>
     <p><font size="4" face="Tahoma,Arial,Helvetica"><u> Forums</u></font></p>
     <ul>
-      <li><u><b><font size="2" face="Tahoma,Arial,Helvetica">Add</font><a name="add"></a></b></u></li>
+      <li><u><b><font size="2" face="Tahoma,Arial,Helvetica">Add Forum</font><a name="add"></a></b></u></li>
     </ul>
     <blockquote>
-    <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the Forums "Add" link brings up a form allowing you to define all aspects of a forum before creating it.  Note that you must assign the forum to a category by selecting one from the drop-down "Category" menu.  The "Description" field cannot be left
-    blank.</font></p>
+    <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the "Add Forum" link brings up a form allowing you to define all aspects of a forum before creating it. Note that you must assign the forum to a category by selecting one from the drop-down "Category" menu. The "Name" field cannot be left blank.</font></p>
     </blockquote>
-    <ul><li><b><u><font size="2" face="Tahoma,Arial,Helvetica">List</font><a name="list"></a></u></b></li>
+    <ul><li><b><u><font size="2" face="Tahoma,Arial,Helvetica">Add Category</font><a name="list"></a></u></b></li>
     </ul>
     <blockquote>
-    <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the "List" link displays a detailed record of all categories and forums in your database.</font></p>
+    <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the "Add Category" link brings up a form allowing you to define all aspects of a category before creating it.  The "Name" field cannot be left blank.</font></p>
     </blockquote>
     <ul>
-      <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">Sort Order</font><a name="sort_order"></a></u></b></li>
+      <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">List All</font><a name="sort_order"></a></u></b></li>
     </ul>
     <blockquote>
-    <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the"Sort Order" link displays a form allowing you to set the order in which your forums and categories will be displayed to users. Forums and categories will be sorted by the values entered in the fields beside them, with the forums with the highest values being displayed at the top of the category, and the categories with the highest values being displayed at the top of the page.</font></p>
+    <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the "List All" link displays a hierarchical list of all categories and forums in your database.  Categories will be underlined.  Individual categories and forums can be viewed in detail, modified or deleted by clicking the "Details", "Modify" and "Delete" links beside each category or forum name.  To see detailed records of all forums or categories, click the "Forums" or "Categories" links at the top of the page.</font></p>
     </blockquote>
-
-    <p>&nbsp;</p>
-    <p><font size="4" face="Tahoma, Arial, Helvetica"><u>Categories</u></font></p>
     <ul>
-      <li><u><b><font face="Tahoma, Arial, Helvetica" size="2">Add<a name="cat_add"></a></font></b></u></li>
-    </ul>
-    <blockquote>
-      <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking the Categories "Add" link brings up a form allowing you to define all aspects of a category before creating it.  The "Name" field cannot be left blank.</font></p>
-    </blockquote>
-    <ul><li><b><u><font face="Tahoma, Arial, Helvetica" size="2">List<a name="cat_list"></a></font></u></b></li>
-    </ul>
-    <blockquote>
-    <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking Clicking the "List" link displays a detailed record of all categories and forums in your database.</font></p>
-    </blockquote>
-    <ul>
-      <li><font face="Tahoma, Arial, Helvetica" size="2"><b><u>Sort Order</u></b></font><b><u><font face="Tahoma, Arial, Helvetica" size="2"><a name="cat_sort_order"></a></font></u></b></li>
+      <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">Sort Order</font><a name="sort_order"></a></u></b></li>
     </ul>
     <blockquote>
-    <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking the"Sort Order" link displays a form allowing you to set the order in which your forums and categories will be displayed to users. Forums and categories will be sorted by the values entered in the fields beside them, with the forums with the highest values being displayed at the top of the category, and the categories with the highest values being displayed at the top of the page.</font></p>
-    </blockquote>
-    <blockquote>
-    <p>&nbsp;</p>
+    <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the "Sort Order" link displays a form allowing you to set the order in which your forums and categories will be displayed to users. Forums and categories will be sorted by the values entered in the fields beside them in ascending order, with the forums with the lowest values being displayed at the top of the category, and the categories with the lowest values being displayed at the top of the page.</font></p>
     </blockquote>

 </TD>
Index: admin/help/help_guide_mailarc.html
===================================================================
RCS file: admin/help/help_guide_mailarc.html
diff -N admin/help/help_guide_mailarc.html
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ admin/help/help_guide_mailarc.html  4 Jan 2002 20:08:13 -0000       1.1
@@ -0,0 +1,747 @@
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>Gossamer Forum Help: Plug Ins</title>
+</head>
+
+<body>
+
+<H1><font face="Verdana, Arial, Helvetica">Gossamer Forum Help</font></H1>
+
+<TABLE width=100%>
+<TR>
+<TD align="right" valign="top">
+<HR>
+<B><a href="admin.cgi?do=help&topic=help_toc.html"><font face="Verdana, Arial, Helvetica" size="2">Table
+of Contents</font></a></B>
+</TD>
+</TR>
+</TABLE>
+
+<table width="100%" cellpadding="20">
+  <tr>
+    <td>
+
+    <p><font face="Verdana, Arial, Helvetica" size="4"><a href="admin.cgi?do=help&amp;topic=help_guide.html">Gossamer Forum Developers Guide</a>:
+    Sample Plugin</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Sample Plugin - MailArc<br>
+    </b>In this sample, we will develop a sample plugin so you can see the full
+    process from Start to End. It's recommended you open a new browser window
+    with the <a href="admin.cgi?do=page&page=plugin_wizard.html" target="_blank">plugin
+    wizard</a> and follow along. The plugin wizard will create a template for
+    you to use to start your plugin.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">We are going to create MailArc plugin which allows you to use Gossamer Forum as an archive for mailing lists.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 1: Naming your
+    plugin</b><br>
+    You will be prompted to give your plugin a name. The name of your plugin
+    corresponds to the package space it will run under, so it must conform to
+    perls syntax. It should be only letters and numbers, and must not contain
+    spaces. Our sample plugin is called 'MailArc'. Convention dictates that
+    you start with a capital letter. All code will run under the package
+    Plugins::GForum::MailArc. Enter in MailArc in the name of the plugin and hit
+    Create.</font></p>
+<div align="center">
+  <center>
+  <table cellPadding="3" width="500" border="0">
+    <tr>
+      <td vAlign="top" width="50%"><font face="Tahoma,Arial,Helvetica" size="2">Create
+        new plugin named:</font></td>
+      <td vAlign="top" width="50%">
+        <form>
+                       <font face="Tahoma,Arial,Helvetica" size="2"><input value="MailArc" name="plugin_name" size="20">
+          <input type="button" value="Next  &gt;&gt;" name="next"></font>
+        </form>
+      </td>
+    </tr>
+  </table>
+  </center>
+</div>
+    </FORM>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 2: Meta Information</b><br>
+    The next step is to edit meta information about your plugin. This
+    contains information about your plugin that will be used by Gossamer Forum when
+    users install it. You must enter at a minimum a Version Number, but should
+    fill out all the fields completely.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">It's very important to
+    update the version number when you make changes. When users download plugins,
+    they are presented with the version number, and from that can decide if they
+    want to upgrade an existing installation.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">To start, we'll enter:</font></p>
+    <form>      
+      <div align="center">
+        <center>
+  <table cellPadding="3" width="500" border="0">
+      <tr>
+        <td>
+          <table borderColor="#c0c0c0" cellSpacing="0" cellPadding="3" width="100%" border="1">
+            <tbody>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Version:</font></td>
+                <td>
+                  <p><font face="Tahoma,Arial,Helvetica" size="2"><input value="1.0.0" name="version" size="20"></font></p>
+                </td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Author:</font></td>
+                <td><font face="Tahoma,Arial,Helvetica" size="2"><input size="40" value="Alex Krohn" name="author"></font></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">URL:</font></td>
+                <td><font face="Tahoma,Arial,Helvetica" size="2"><input size="40" value="http://www.gossamer-threads.com" name="url"></font></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">License:</font></td>
+                <td><select size="1" name="license">
+                    <option selected>Freeware</option>
+                    <option>GPL</option>
+                    <option>Shareware</option>
+                    <option>Commercial</option>
+                    <option>Other</option>
+                  </select></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Gossamer Forum Version Required:</font></td>
+                <td><font face="Tahoma,Arial,Helvetica" size="2"><input value="1.0.0" name="prog_ver" size="20"></font></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Description:</font></td>
+                <td><textarea name="description" rows="5" cols="40">This plugin will allow you to use Gossamer Forum as an archive for mailing lists.</textarea></td>
+              </tr>
+            </tbody>
+          </table>
+        </td>
+      </tr>
+  </table>
+        </center>
+      </div>
+    </form>
+<p><font face="Tahoma,Arial,Helvetica" size="2">and hit next. This information
+will now be saved with your plugin.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step3: Hooking into Gossamer Forum</b><br>  
+We don't need to hook Gossamer Forum, so we just skip this step.
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 4: Admin Menu<br>
+</b>We have an admin menu for helping. We'll enter:</font></p>
+<center>
+       <table cellPadding="3" width="500" border="0">
+      <tr>
+        <td>
+          <table borderColor="#c0c0c0" cellSpacing="0" cellPadding="3" width="100%" border="1">
+            <tbody>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Name:</font></td>
+                <td>
+                  <p><font face="Tahoma,Arial,Helvetica" size="2"><input type="text" name="name" size="40" value="About"></font></p>
+                </td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">URL:</font></td>
+                <td>
+                  <p><font face="Tahoma,Arial,Helvetica" size="2"><input type="text" name="url" size="40" value="admin.cgi?do=plugin&plugin=MailArc&func=about"></font></p>
+                </td>
+              </tr>
+                </table>
+               </td>
+         </tr>
+       </table>
+</center>
+<p><font face="Tahoma,Arial,Helvetica" size="2">Hit next to continue</p>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 5: User Options</b>&nbsp;<br>
+User options are variables you can have the plugin user fill out and access in
+your plugin. We won't do any for this, but maybe for the next version we will
+add a user option for how long the cache should last.</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 6: Included Files<br>
+</b>Every plugin needs at least an Install.pm and a ModuleName.pm (in our case
+MailArc.pm). The plugin wizard will automatically generate these two files
+for you. It is quite common to need to bundle other files though, from images,
+to user cgi. From here you can upload those files that you need and the plugin
+wizard will bundle it in your plugin and create the install function for you.</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2">We don't need any extra files
+for the MailArc, so we hit next.</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 7: Install Messages<br>
+</b>The last step is too add an install and uninstall message. This should
+explain to the user what the plugin will do exactly during the install and
+uninstall: i.e. what column it will add, what files it will install,
+etc.&nbsp;</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2">We also need to add any custom
+install and uninstall code. The Wizard takes care of hooking into Gossamer Forum, but
+we need to provide code to add post_message_id to Post table. Fill in the form with the following
+information:</font></p>
+    <form method="POST" action="--WEBBOT-SELF--">
+      <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
+      S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
+      <div align="center">
+        <center>
+        <table borderColor="#C0C0C0" cellSpacing="0" cellPadding="3" width="500" border="1">
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Install
+              Message</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="install" rows="5" wrap="on" cols="40"><table border=1 cellpadding=0 cellspacing=0><tr><td>
+<table cellpadding=3 cellspacing=3 width=500><tr><td><font face="Tahoma,Arial,Helvetica" size=2>
+Welcome to the MailArc plugin installer. This will install MailArc plugin on your GForum. 
+The plugin will enhance the capability of your Gossamer Forum and will be 
+used as an mailing-list archiver. It will store each mailing-list email like a post and allows the 
+users viewing or seaching any messages through their browser. The MailArc plugin will add 
+post_email_id column in Post table where all message-ids are stored. This message-id 
+will be used to specify which post is either a new or a replied message.</td></tr></table></td></tr></table></textarea></font></td>
+          </tr>
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">UnInstall
+              Message</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="uninstall" rows="5" wrap="on" cols="40"><table border=1 cellpadding=0 cellspacing=0><tr><td>
+<table border=0 cellpadding=3 cellspacing=3 width=500><tr><td><font face="Tahoma,Arial,Helvetica" size=2>
+This will remove MailArc Plugin.
+</td></tr></table></td></tr></table></textarea></font></td>
+          </tr>
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Install
+              Code</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="install_code" rows="5" wrap="off" cols="40">my ($mgr, $tar) = @_;
+    $mgr->install_menu ( 'MailArc', [ ['About', 'admin.cgi?do=plugin&plugin=MailArc&func=about'] ] );
+
+# add new column to Post table
+    my $editor = $DB->editor ('Post');
+    $editor->add_col ("post_email_id", 
+                                        { size      => 50, 
+                                          type      => 'varchar', 
+                                          form_type => 'TEXT'}
+                    ) or Plugins::GForum::MailArc->error("Warning: $GT::SQL::error", 'WARN');
+    my $content =  <<'END_ARCHIVE';
+#!/usr/bin/perl
+
+    use lib '..';
+    use strict;
+    
+    main();
+
+sub main {
+#----------------------------------------------------------
+#
+    require Plugins::GForum::MailArc;
+    my $mail_arc = new Plugins::GForum::MailArc;
+    $mail_arc->process();
+}  
+END_ARCHIVE
+
+    $content =~ s,\.\.,$CFG->{admin_root_path},;
+    open (FILE,"> $CFG->{admin_root_path}/Plugins/GForum/archive.pl") or Plugins::GForum::MailArc->error("Cannot create archive.pl: $!","FATAL");
+    print FILE $content;    
+    close FILE;
+    chmod (0755,"$CFG->{admin_root_path}/Plugins/GForum/archive.pl");
+    
+    return "The MailArc plugin has been successfully installed!";
+                       </textarea></font></td>
+          </tr>
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Uninstall
+              Message</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="uninstall_code" rows="5" wrap="off" cols="40">my $mgr = shift;
+    unlink ("$CFG->{admin_root_path}/Plugins/GForum/archive.pl");
+    $mgr->uninstall_menu ( 'MailArc', [ ['About', 'admin.cgi?do=plugin&plugin=MailArc&func=about'] ] );
+
+# Drop post_email_id coulmn
+    my $editor = $DB->editor ('Post');                                                                   
+    $editor->drop_col ("post_email_id") or Plugins::GForum::MailArc->error("Unable to drop column post_email_id ($GT::SQL::error)", 'WARN');                                                                  
+    return "The MailArc plugin has been successfully removed!";
+                       </textarea></font></td>
+          </tr>
+        </table>
+        </center>
+      </div>
+      <p><font face="Tahoma,Arial,Helvetica" size="2">You are now all done! Hit
+      Next and the plugin wizard will create the plugin template for you. It has
+      automatically generated an Install.pm file and a MailArc.pm file for
+      you. The Install file should be pretty much complete, so all you have left
+      to do is edit the MailArc.pm file.</font></p>
+      <p><font face="Tahoma,Arial,Helvetica" size="2">Click on the Plugin Editor
+      to finish the job!</font></p>
+      <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 9: Insert your
+      code<br>
+      </b>Now you should see a screen that looks something like:</font></p>
+      <div align="center">
+        <center>
+        <table cellSpacing="0" cellPadding="0" border="1">
+          <tbody>
+            <tr>
+              <td>
+                <table width="500" border="0">
+                  <tbody>
+                    <tr>
+                      <td align="middle" bgColor="#dddddd" colSpan="2"><font face="Tahoma,Arial,Helvetica" size="3"><b>Plugin
+                        Details</b></font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Plugin:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">MailArc</font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Version:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">1.0.0</font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Author:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Alex Krohn</font></td>
+                    </tr>
+                    <tr>
+                      <td vAlign="top"><font face="Tahoma,Arial,Helvetica" size="2">License:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Freeware</font></td>
+                    </tr>
+                    <tr>
+                      <td vAlign="top"><font face="Tahoma,Arial,Helvetica" size="2">Description:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">This plugin will allow you to use Gossamer Forum as an archive for mailing lists.</font></td>
+                    </tr>
+                    <tr>
+                      <td>&nbsp;</td>
+                    </tr>
+                    <tr>
+                      <td align="middle" bgColor="#dddddd" colSpan="2"><font face="Tahoma,Arial,Helvetica" size="3"><b>Plugin
+                        Files</b></font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Install.pm
+                        (4123 bytes)</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2"><font color="#0000FF"><u>Edit</u></font>
+                        | <font color="#0000FF"><u>Perl Check</u></font></font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">MailArc.pm
+                        (12474 bytes)</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2"><font color="#0000FF"><u>Edit</u></font>
+                        | <font color="#0000FF"><u>Perl Check</u></font></font></td>
+                    </tr>
+                  </tbody>
+                </table>
+              </td>
+            </tr>
+          </tbody>
+        </table>
+        </center>
+      </div>
+      <p><font face="Tahoma,Arial,Helvetica" size="2">Now we need to add our
+      code for the Mail Archive . Click on Edit for MailArc.pm and enter:</font></p>
+      <p align="center"><textarea rows="8" name="code" wrap="off" cols="50">
+# ==================================================================
+# Plugins::GForum::MailArc - use GT as an archive for mailing list
+#
+#   Plugins::GForum::MailArc
+#   Author  : Gossamer Threads Inc
+#   Version : 1.0.0
+#   Updated : Tue Dec 18 16:50:12 2001
+#
+# ==================================================================
+#
+
+package Plugins::GForum::MailArc;
+# ==================================================================
+
+    use strict;
+    use vars qw/@ISA $ERRORS $VERSION $DEBUG $error/;
+    use GForum qw/$DB $CFG $IN/;
+
+    use GT::Mail::Parse;
+    use GT::Date qw/timelocal parse_format/;
+    use GT::Base qw/:all/;  # Imports $MOD_PERL $SPEEDY $PERSIST
+
+    # System modules
+    use Getopt::Long;
+    $VERSION = '1.0';
+    $DEBUG   = 0;
+    $ERRORS  = {
+                'BADFORUMID'   => "Please send forum id, your command shoud be: perl archive.pl --forum=xx",
+                'BADINPUT'     => "The data content is empty",
+                'BADUSERNAME'  => "Can not parse the user name.",
+                'WARNING'      => "Error: %s",
+                };
+    @ISA = qw/GT::Base/;
+
+sub process () {
+#----------------------------------------------------------
+    my ($self) = @_;
+
+    GetOptions('forum=s' => \$self->{input}->{forum_id}); # get forum ID 
+    ($self->{input}->{forum_id}) or return $self->error("BADFORUMID","WARN");
+    my $mail;
+    {
+        local $/;
+        $mail = <STDIN>;
+    } 
+    $mail =~ s/\r?\n/\n/g;
+    $mail or return $self->error("BADINPUT","WARN");
+
+    my $parser = new GT::Mail::Parse (
+        debug     => $CFG->{debug_level},
+        in_string => $mail,
+        crlf      => "\n"
+    ) or return $self->error("WARNING","WARN",$GT::Mail::error);
+
+    $self->{input}->{head}     = $parser->parse or return $self->error("BADINPUT","WARN");   
+    $self->{input}->{parts}    = $parser->parts;
+    $self->{user}->{user_name} = parse_email($self->{input}->{head}->get('From'));
+    ($self->{user}->{user_name}) or return $self->error("BADUSERNAME","WARN");
+
+# Create new disabled user
+    $self->create_disabled_user();
+
+#add message
+    $self->insert_message();
+}
+
+sub create_disabled_user {
+#-------------------------------------------------------
+# create new disabled user
+#
+    my $self = shift;
+    my $table = $DB->table('User');
+    my $rs = $table->select({user_username => $self->{user}->{user_name}})->fetchrow_hashref;
+    if ($rs->{user_username}) {
+        $self->{user}->{user_id} = $rs->{user_id};
+    }
+    else {
+        my $cols = $table->{schema}->{cols};
+        my $fields;
+        $fields->{user_username}    = $self->{user}->{user_name};
+        $fields->{user_email}       = $self->{user}->{user_name};
+        $fields->{user_disp_email}  = $self->{user}->{user_name};
+        $fields->{user_enabled}     = 0;
+        my $sth = $table->insert($fields) or return $self->error("WARNING","FATAL",$GT::SQL::error);
+        $self->{user}->{user_id} = $sth->insert_id;
+    }
+}
+
+sub insert_message {
+#----------------------------------------------------------
+# Insert a message
+#
+    my $self = shift;
+    my $post_time;
+
+    my $head = $self->{input}->{head};
+    my $date = $head->get('Date');
+    ($date) and $post_time = parse_date($date);
+
+    my $table  = $DB->table('Post');
+    my $fields;    
+    my $body   = $self->get_body();
+
+    my $msgid = $head->get('message-id');
+    $msgid =~ s,[< >],,g;
+
+    $fields->{post_username} = $self->{user}->{user_name};
+    $fields->{user_id_fk}    = $self->{user}->{user_id};
+    $fields->{forum_id_fk}   = $self->{input}->{forum_id};
+    $fields->{post_root_id}  = 0;
+    $fields->{post_father_id}= 0;
+    $fields->{post_depth}    = 0;
+    $fields->{post_time}     = $post_time || time;
+    $fields->{post_subject}  = $head->get('Subject');
+    $fields->{post_style}    = ($head->effective_type eq 'text/plain') ? 0 : 2;
+    $fields->{post_message}  = $body->{body};
+    $fields->{post_email_id} = $msgid;
+    $fields->{post_ip}       = ($head->get('received'))? $self->get_ip() : '0.0.0.0';        
+    
+    my ($refid,$msg_list);
+    $msg_list = $head->get('references') || $head->get('in-reply-to');
+    ($msg_list) and $refid = parse_ref($msg_list);
+
+    if ($refid) { #this is a reply to an existing message        
+        my $parent = $DB->table('Post')->select({ post_email_id => $refid })->fetchrow_hashref;
+        if ($parent) {
+            $fields->{post_root_id}   = $parent->{post_root_id} || $parent->{post_id};
+            $fields->{post_father_id} = $parent->{post_id};
+            $fields->{post_depth}     = $parent->{post_depth} + 1;
+        }
+    }      
+
+    my $table = $DB->table('Post');
+    my $sth   = $table->insert($fields) or return $self->error("WARNING","FATAL",$GT::SQL::error);    
+    my $post_id = $sth->insert_id;
+
+# add the attachments
+    require GT::TempFile;
+    my $name = new GT::TempFile;    
+    my $path = $$name.'tmp';
+    my $attachments = $body->{attachments}; 
+    if ($#$attachments >=0) {
+        mkdir ($path,0777) or return $self->error("WARNING","FATAL",$!);
+        foreach (@$attachments) {
+            if ($_->{name}) {
+                open (FILE, "> $path/$_->{name}") or return $self->error("WARNING","FATAL",$!);;
+                print FILE $_->{content};
+                close FILE;
+                $table->attach($post_id, "$path/$_->{name}");
+                unlink "$path/$_->{name}";
+            }
+        }
+        rmdir ($path) or return $self->error("WARNING","FATAL",$!);;
+    }
+}
+
+sub get_ip {
+# -------------------------------------------------------------------
+# get IP address
+    my $self = shift;
+    my $received = $self->{input}->{head}->{header_lines}->{received};
+    if (ref $received eq 'ARRAY'){
+        my $line = pop @{$received};
+        $line =~ m/([^\(]*?\d)\)/; 
+        return ($1)?$1:'0.0.0.0';
+    }
+    else {
+        return '0.0.0.0';
+    }
+}
+
+sub get_body {
+#--------------------------------------------------------------------
+# Parse the body
+#
+    my $self = shift;
+
+    my $head  = $self->{input}->{head};
+    my $parts = $self->{input}->{parts};
+
+    my $type = uc($head->mime_attr('content-type'));
+    my ($body, @attachments);
+
+    if ($type eq 'TEXT/PLAIN' or $type eq 'TEXT/HTML') {
+        $body = $head->body_as_string;
+    }
+    else {
+        for (@$parts) {
+            my $attach = $_->mime_attr('content-disposition') and uc($_->mime_attr('content-disposition')) eq 'ATTACHMENT';
+            if ($attach) {
+                my $in = $_->body_in;
+                my $body;
+                if ($in eq 'MEMORY') {
+                    $body = $_->body_data;
+                }
+                elsif ($in eq 'HANDLE') {
+                    $body = $_->body_handle;
+                }
+                elsif ($in eq 'FILE') {
+                    $body = $_->body_path;
+                }
+                ($body) and push @attachments, { name => $_->mime_attr('content-disposition.filename'), content => $body };
+            }
+            elsif (uc($_->mime_attr('content-type')) eq 'TEXT/PLAIN') {
+                $body = $_->body_as_string;
+            }
+            elsif (uc($_->mime_attr('content-type')) ne 'TEXT/HTML') {
+            #    push @attachments, $_;
+            }
+        }
+        if ( !$body ) {
+            for (@$parts) {
+                next if $_->mime_attr('content-disposition') and uc($_->mime_attr('content-disposition')) eq 'ATTACHMENT';
+                if ( uc($_->mime_attr('content-type')) eq 'TEXT/HTML') {
+                    $body = $_->body_as_string;
+                    last;
+                }
+             }
+         }
+         $body ||= '';                 
+    }
+    return { body => $body, attachments => \@attachments};
+}
+
+sub about {
+# -------------------------------------------------------------------
+# Called from the admin, displays a simple help screen.
+#
+    print $IN->header;
+    print qq~
+<html>
+    <head><title>MailArc Plugin</title>
+    </head>
+    <body bgcolor="#FFFFFF">    
+    <table border="1" cellpadding="0" cellspacing="0"><tr><td>
+      <table bgColor="#ffffff" border="0" cellPadding="3" cellSpacing="3" width="600" valign="top">
+        <tr>
+          <td align="left" bgColor="navy"><b><font color="#ffffff" size="2" face="Tahoma,Arial,Helvetica">MailArc Plugin</font></b></td>
+        </tr>
+        <tr>
+          <td>
+               <p align="center"><b><font color="#000000" size="2" face="Tahoma,Arial,Helvetica">MailArc Plugin</font></b></p>
+               <p><font size="2" face="Tahoma,Arial,Helvetica">
+                This plugin will allow you to use Gossamer Forum as an archive for mailing list.<BR><BR></p>             
+                <b>+ Install MailArc plugin:</b>
+                 <ul>
+                 - Goto Admin - Plugins - Plugin Manager<BR>
+                 - Hit 'Install' link of MailArc row, It will install the MailArc plugin in your forum system. <BR>
+                 If you want to know how to create MailArc plugin then take a look at <a href="admin.cgi?do=help;topic=help_guide_mailarc.html" target="plugin_guide">MailArc plugin guide</a></ul>
+                <b>+ Use MailArc plugin:</b> The command which is used to run MailArc plugin<BR><BR>
+                <b>$CFG->{admin_root_url}/Plugins/GForum/MailArc/archive.pl --forum=n</b><BR> (n - is the forum ID)                
+          </td>
+        </tr>
+      </table>
+      </td></tr>
+    </table>
+    </body>
+    ~;    
+    print qq~
+    </body>
+</html>
+    ~;
+}
+
+sub parse_ref {
+#---------------------------------------------------------------------
+# return reference message id
+#
+    my $value = shift;
+    my $ref = [split /\s/, $value];
+    my $refid = @$ref[$#$ref];
+    $refid =~ s,[< >],,g;
+    return $refid;
+}
+
+sub parse_email {
+# -------------------------------------------------------------------
+# Return a hash contains name and email from email header if applicable
+    my $value = shift;
+
+    my $result;
+    if ($value =~ /"?([^<"]+)"?\s*<([^>]+)>/) {
+        $result = $2;
+    }
+    elsif ($value =~ /<([^>]+)>/) {
+        $result = $1;
+    }
+    else {
+        $result = $value || '';
+        $result =~ s/\([^)]+\)//g;
+    }
+
+    chop $result;
+    chomp $result;
+    return $result;
+}
+
+sub parse_date {
+# -------------------------------------------------------------------
+# Internal use, not usfull from a template.
+# Parse an RFC 822 5.1 compliant date into one understood by mysql.
+# Formats expected:
+#    Sat, 28 Jul 2001 08:44:00 -0700
+#    Sat, 28 Jul 2001 08:44:00 EST
+#    Sat, 28 Jul 2001 08:44:00 "EST"
+#    Sat, 21 Jul 01 19:07:20
+#    28 Jul 2001 14:57:07 -0000
+#    28 Jul 2001 14:57:07 GMT
+#    28 Jul 2001 14:57:07 "GMT"
+#    20 May 01 6:33:30 PM
+#
+# Only the first date is an RFC date, but it appears lots of clients don't
+# use the RFC.
+#
+    my $date = shift;
+    $date || return;
+    my $format;
+    $date =~ s/\s\s/\s/g;
+    CASE: for ($date) {
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d (?:[+-]\d+|\w+)/    and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss% %o%'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d "(?:[+-]\d+|\w+)"/  and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss% "%o%"'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d/                    and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss%'; last CASE };
+        /\w+, \d\d? \w+ \d{2} \d?\d:\d?\d:\d\d/                    and do { $format = '%ddd%, %dd% %mmm% %yy% %HH%:%MM%:%ss%'; last CASE };
+        
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d (?:[+-]\d+|\w+)/   and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss% %o%'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d "(?:[+-]\d+|\w+)"/ and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss% "%o%"'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d/                   and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss%'; last CASE };
+        /\w+, \d\d? \w+ \d{2} \d?\d:\d?\d:\d\d/                   and do { $format = '%ddd%, %dd% %mmm% %yy% %HH%:%MM%:%ss%'; last CASE };
+
+        /\d\d? \w+ \d{4} \d?\d:\d?\d:\d\d (?:[+-]\d+|\w+)/         and do { $format = '%dd% %mmm% %yyyy% %HH%:%MM%:%ss% %o%'; last CASE };
+        /\d\d? \w+ \d{4} \d?\d:\d?\d:\d\d "(?:[+-]\d+|\w+)"/       and do { $format = '%dd% %mmm% %yyyy% %HH%:%MM%:%ss% "%o%"'; last CASE };
+        /\d\d? \w+ \d{2} \d?\d:\d?\d:\d\d [AaPpMm]{2}/             and do { $format = '%dd% %mmm% %yy% %hh%:%MM%:%ss% %tt%'; last CASE };
+    } 
+    $format or return;        
+    my $parts    = [split /\s/, $date];
+    my $str_date = fill_zero($parts);
+    my $time     = [split /:/, @$parts[4]];
+    my $str_time = fill_zero($time,":");
+    $str_date =~ s/@$parts[4]/$str_time/;
+    return timelocal(parse_format($str_date, $format));
+}
+
+sub fill_zero {
+#-------------------------------------------------------
+    my ($value,$delim) = @_;
+    $delim ||= ' ';
+    my $result;
+    (ref $value eq 'ARRAY') or return $value;
+    foreach (@$value) {
+        (/\d\d?/ and length($_) == 1) and $_ = "0$_";
+        $result .= $_.$delim;
+    }
+    chop $result;
+    return $result;
+}
+
+1;
+</textarea></p>
+    </form>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">Simply cut and paste the
+    above code into the edit box, and hit update. To make sure everything is
+    correct, you can click on Perl Check to run a syntax check on it. Try it and
+    you should see
+    'MailArc.pm syntax ok'.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">A couple things to note about
+    the code:</font></p>
+    <table border="0" cellpadding="2" width="80%">
+      <tr>
+        <td valign="top">
+          <pre>package Plugins::GForum::MailArc;</pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">Don't forget to put
+          your code inside the proper package or it will never work.</font></td>
+      </tr>
+      <tr>
+        <td valign="top"><pre>use strict; </pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">Always, always run your
+          plugins under use strict. If you want your plugin to be mod_perl
+          compatible, this will be essential.</font></td>
+      </tr>      
+      <tr>
+        <td valign="top">
+          <pre>use GT::Mail::Parse;</pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">This module lets you
+          parse the contents of an email.</font></td>
+      </tr>      
+      <tr>
+        <td valign="top">
+          <pre>use GT::Date qw/timelocal parse_format/;</pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">GT::Date provides several functions useful in parsing dates, and 
+doing date manipulation.</font></td>
+      </tr>  
+      <tr>
+        <td valign="top">
+          <font face="Tahoma,Arial,Helvetica" size="2">1;</font>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">Don't forget, all
+          module must end with a 1; or they won't be able to get require'd in
+          properly.</font></td>
+      </tr>
+    </table>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 10: All Done, try it
+out!<br>
+    </b>Now, we are all done! Click on Plugin Manager and it should be listed as
+a plugin waiting to be installed. Click on Install and you should now be able to
+try it out!</font></p>
+    </td>
+  </tr>
+</table>
+
+<TABLE width=100%>
+<TR>
+<TD align="right" valign="top">
+<B><a href="admin.cgi?do=help&topic=help_toc.html"><font face="Verdana, Arial, Helvetica" size="2">Table
+of Contents</font></a></B>
+<HR>
+</TD>
+</TR>
+</TABLE>
+
+</body>
+
Index: admin/help/help_guide_sample.html
===================================================================
RCS file: admin/help/help_guide_sample.html
diff -N admin/help/help_guide_sample.html
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ admin/help/help_guide_sample.html   28 Dec 2001 00:48:38 -0000      1.1
@@ -0,0 +1,708 @@
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>Gossamer Forum Help: Plug Ins</title>
+</head>
+
+<body>
+
+<H1><font face="Verdana, Arial, Helvetica">Gossamer Forum Help</font></H1>
+
+<TABLE width=100%>
+<TR>
+<TD align="right" valign="top">
+<HR>
+<B><a href="admin.cgi?do=help&topic=help_toc.html"><font face="Verdana, Arial, Helvetica" size="2">Table
+of Contents</font></a></B>
+</TD>
+</TR>
+</TABLE>
+
+<table width="100%" cellpadding="20">
+  <tr>
+    <td>
+
+    <p><font face="Verdana, Arial, Helvetica" size="4"><a href="admin.cgi?do=help&amp;topic=help_guide.html">Gossamer Forum Developers Guide</a>:
+    Sample Plugin</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Sample Plugin - MailArc<br>
+    </b>In this sample, we will develop a sample plugin so you can see the full
+    process from Start to End. It's recommended you open a new browser window
+    with the <a href="admin.cgi?do=page&page=plugin_wizard.html" target="_blank">plugin
+    wizard</a> and follow along. The plugin wizard will create a template for
+    you to use to start your plugin.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">We are going to create MailArc plugin which allows you to use Gossamer Forum as an archive for mailing lists.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 1: Naming your
+    plugin</b><br>
+    You will be prompted to give your plugin a name. The name of your plugin
+    corresponds to the package space it will run under, so it must conform to
+    perls syntax. It should be only letters and numbers, and must not contain
+    spaces. Our sample plugin is called 'MailArc'. Convention dictates that
+    you start with a capital letter. All code will run under the package
+    Plugins::GForum::MailArc. Enter in MailArc in the name of the plugin and hit
+    Create.</font></p>
+<div align="center">
+  <center>
+  <table cellPadding="3" width="500" border="0">
+    <tr>
+      <td vAlign="top" width="50%"><font face="Tahoma,Arial,Helvetica" size="2">Create
+        new plugin named:</font></td>
+      <td vAlign="top" width="50%">
+        <form>
+                       <font face="Tahoma,Arial,Helvetica" size="2"><input value="MailArc" name="plugin_name" size="20">
+          <input type="button" value="Next  &gt;&gt;" name="next"></font>
+        </form>
+      </td>
+    </tr>
+  </table>
+  </center>
+</div>
+    </FORM>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 2: Meta Information</b><br>
+    The next step is to edit meta information about your plugin. This
+    contains information about your plugin that will be used by Gossamer Forum when
+    users install it. You must enter at a minimum a Version Number, but should
+    fill out all the fields completely.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">It's very important to
+    update the version number when you make changes. When users download plugins,
+    they are presented with the version number, and from that can decide if they
+    want to upgrade an existing installation.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">To start, we'll enter:</font></p>
+    <form>      
+      <div align="center">
+        <center>
+  <table cellPadding="3" width="500" border="0">
+      <tr>
+        <td>
+          <table borderColor="#c0c0c0" cellSpacing="0" cellPadding="3" width="100%" border="1">
+            <tbody>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Version:</font></td>
+                <td>
+                  <p><font face="Tahoma,Arial,Helvetica" size="2"><input value="1.0.0" name="version" size="20"></font></p>
+                </td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Author:</font></td>
+                <td><font face="Tahoma,Arial,Helvetica" size="2"><input size="40" value="Alex Krohn" name="author"></font></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">URL:</font></td>
+                <td><font face="Tahoma,Arial,Helvetica" size="2"><input size="40" value="http://www.gossamer-threads.com" name="url"></font></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">License:</font></td>
+                <td><select size="1" name="license">
+                    <option selected>Freeware</option>
+                    <option>GPL</option>
+                    <option>Shareware</option>
+                    <option>Commercial</option>
+                    <option>Other</option>
+                  </select></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Gossamer Forum Version Required:</font></td>
+                <td><font face="Tahoma,Arial,Helvetica" size="2"><input value="1.0.0" name="prog_ver" size="20"></font></td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Description:</font></td>
+                <td><textarea name="description" rows="5" cols="40">This plugin will allow you to use Gossamer Forum as an archive for mailing lists.</textarea></td>
+              </tr>
+            </tbody>
+          </table>
+        </td>
+      </tr>
+  </table>
+        </center>
+      </div>
+    </form>
+<p><font face="Tahoma,Arial,Helvetica" size="2">and hit next. This information
+will now be saved with your plugin.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step3: Hooking into Gossamer Forum</b><br>  
+We don't need to hook Gossamer Forum, so we just skip this step.
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 4: Admin Menu<br>
+</b>We have an admin menu for helping. We'll enter:</font></p>
+<center>
+       <table cellPadding="3" width="500" border="0">
+      <tr>
+        <td>
+          <table borderColor="#c0c0c0" cellSpacing="0" cellPadding="3" width="100%" border="1">
+            <tbody>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Name:</font></td>
+                <td>
+                  <p><font face="Tahoma,Arial,Helvetica" size="2"><input type="text" name="name" size="40" value="About"></font></p>
+                </td>
+              </tr>
+              <tr>
+                <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">URL:</font></td>
+                <td>
+                  <p><font face="Tahoma,Arial,Helvetica" size="2"><input type="text" name="url" size="40" value="admin.cgi?do=plugin&plugin=MailArc&func=about"></font></p>
+                </td>
+              </tr>
+                </table>
+               </td>
+         </tr>
+       </table>
+</center>
+<p><font face="Tahoma,Arial,Helvetica" size="2">Hit next to continue</p>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 5: User Options</b>&nbsp;<br>
+User options are variables you can have the plugin user fill out and access in
+your plugin. We won't do any for this, but maybe for the next version we will
+add a user option for how long the cache should last.</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 6: Included Files<br>
+</b>Every plugin needs at least an Install.pm and a ModuleName.pm (in our case
+MailArc.pm). The plugin wizard will automatically generate these two files
+for you. It is quite common to need to bundle other files though, from images,
+to user cgi. From here you can upload those files that you need and the plugin
+wizard will bundle it in your plugin and create the install function for you.</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2">We don't need any extra files
+for the MailArc, so we hit next.</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 7: Install Messages<br>
+</b>The last step is too add an install and uninstall message. This should
+explain to the user what the plugin will do exactly during the install and
+uninstall: i.e. what column it will add, what files it will install,
+etc.&nbsp;</font></p>
+<p><font face="Tahoma,Arial,Helvetica" size="2">We also need to add any custom
+install and uninstall code. The Wizard takes care of hooking into Gossamer Forum, but
+we need to provide code to add post_message_id to Post table. Fill in the form with the following
+information:</font></p>
+    <form method="POST" action="--WEBBOT-SELF--">
+      <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
+      S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
+      <div align="center">
+        <center>
+        <table borderColor="#C0C0C0" cellSpacing="0" cellPadding="3" width="500" border="1">
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Install
+              Message</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="install" rows="5" wrap="on" cols="40">The MailArc plugin will create a new column in Post table that logs all message ID from mailing lists.
+Also, it will create archive.pl file.</textarea></font></td>
+          </tr>
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">UnInstall
+              Message</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="uninstall" rows="5" wrap="on" cols="40">Removing the MailArc plugin will erase archive.pl, but will not harm your Gossamer Forum installation.</textarea></font></td>
+          </tr>
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Install
+              Code</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="install_code" rows="5" wrap="off" cols="40">my ($mgr, $tar) = @_;
+    $mgr->install_menu ( 'MailArc', [ ['About', 'admin.cgi?do=plugin&plugin=MailArc&func=about'] ] );
+
+# add new column to Post table
+    my $editor = $DB->editor ('Post');
+    $editor->add_col ("post_email_id", 
+                                        { size      => 50, 
+                                          type      => 'varchar', 
+                                          form_type => 'TEXT'}
+                    ) or Plugins::GForum::MailArc->error("Warning: $GT::SQL::error", 'WARN');
+    my $content =  <<'END_ARCHIVE';
+#!/usr/bin/perl
+
+    use lib '..';
+    use strict;
+    use GForum qw/$DB $CFG/;
+    GForum::reset_env();
+    
+    main();
+
+sub main {
+#----------------------------------------------------------
+#
+    require Plugins::GForum::MailArc;
+    my $mail_arc = new Plugins::GForum::MailArc;
+    $mail_arc->process( sql => $DB, cfg => $CFG);
+}  
+END_ARCHIVE
+
+    $content =~ s,\.\.,$CFG->{admin_root_path},;
+    open (FILE,"> $CFG->{admin_root_path}/Plugins/GForum/archive.pl") or Plugins::GForum::MailArc->error("Cannot create archive.pl: $!","FATAL");
+    print FILE $content;    
+    close FILE;
+    chmod (0775,"$CFG->{admin_root_path}/Plugins/GForum/archive.pl");
+    
+    return "The MailArc plugin has been successfully installed!";
+                       </textarea></font></td>
+          </tr>
+          <tr>
+            <td vAlign="top" width="120"><font face="Tahoma,Arial,Helvetica" size="2">Uninstall
+              Message</font></td>
+            <td><font face="Tahoma,Arial,Helvetica" size="2"><textarea name="uninstall_code" rows="5" wrap="off" cols="40">unlink ("$CFG->{admin_root_path}/Plugins/GForum/archive.pl");
+                       </textarea></font></td>
+          </tr>
+        </table>
+        </center>
+      </div>
+      <p><font face="Tahoma,Arial,Helvetica" size="2">You are now all done! Hit
+      Next and the plugin wizard will create the plugin template for you. It has
+      automatically generated an Install.pm file and a MailArc.pm file for
+      you. The Install file should be pretty much complete, so all you have left
+      to do is edit the MailArc.pm file.</font></p>
+      <p><font face="Tahoma,Arial,Helvetica" size="2">Click on the Plugin Editor
+      to finish the job!</font></p>
+      <p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 9: Insert your
+      code<br>
+      </b>Now you should see a screen that looks something like:</font></p>
+      <div align="center">
+        <center>
+        <table cellSpacing="0" cellPadding="0" border="1">
+          <tbody>
+            <tr>
+              <td>
+                <table width="500" border="0">
+                  <tbody>
+                    <tr>
+                      <td align="middle" bgColor="#dddddd" colSpan="2"><font face="Tahoma,Arial,Helvetica" size="3"><b>Plugin
+                        Details</b></font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Plugin:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">MailArc</font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Version:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">1.0.0</font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Author:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Alex Krohn</font></td>
+                    </tr>
+                    <tr>
+                      <td vAlign="top"><font face="Tahoma,Arial,Helvetica" size="2">License:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Freeware</font></td>
+                    </tr>
+                    <tr>
+                      <td vAlign="top"><font face="Tahoma,Arial,Helvetica" size="2">Description:</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">This plugin will allow you to use Gossamer Forum as an archive for mailing lists.</font></td>
+                    </tr>
+                    <tr>
+                      <td>&nbsp;</td>
+                    </tr>
+                    <tr>
+                      <td align="middle" bgColor="#dddddd" colSpan="2"><font face="Tahoma,Arial,Helvetica" size="3"><b>Plugin
+                        Files</b></font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">Install.pm
+                        (4123 bytes)</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2"><font color="#0000FF"><u>Edit</u></font>
+                        | <font color="#0000FF"><u>Perl Check</u></font></font></td>
+                    </tr>
+                    <tr>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2">MailArc.pm
+                        (12474 bytes)</font></td>
+                      <td><font face="Tahoma,Arial,Helvetica" size="2"><font color="#0000FF"><u>Edit</u></font>
+                        | <font color="#0000FF"><u>Perl Check</u></font></font></td>
+                    </tr>
+                  </tbody>
+                </table>
+              </td>
+            </tr>
+          </tbody>
+        </table>
+        </center>
+      </div>
+      <p><font face="Tahoma,Arial,Helvetica" size="2">Now we need to add our
+      code for the Mail Archive . Click on Edit for MailArc.pm and enter:</font></p>
+      <p align="center"><textarea rows="8" name="code" wrap="off" cols="50">
+# ==================================================================
+# Plugins::GForum::MailArc - Auto Generated Install Module
+#
+#   Plugins::GForum::MailArc
+#   Author  : Gossamer Threads Inc
+#   Version : 1.0.0
+#   Updated : Tue Dec 18 16:50:12 2001
+#
+# ==================================================================
+#
+
+package Plugins::GForum::MailArc;
+# ==================================================================
+
+    use strict;
+    use vars qw/@ISA $ERRORS $VERSION $DEBUG $error/;
+
+    use GT::Mail::Parse;
+    use GT::Date qw/timelocal parse_format/;
+    use GT::Base qw/:all/;  # Imports $MOD_PERL $SPEEDY $PERSIST
+
+    # System modules
+    use Getopt::Long;
+    $VERSION = '1.0.0';
+    $DEBUG   = 0;
+    $ERRORS  = {
+                'BADFORUMID'   => "Please send forum id, your command shoud be: perl archive.pl --forum=xx",
+                'BADINPUT'     => "The data content is empty",
+                'BADCGI'       => "You must pass in a GT::CGI object.",
+                'BADUSERNAME'  => "Can not parse the user name.",
+                'WARNING'      => "Error: %s",
+                };
+    @ISA = qw/GT::Base/;
+
+sub process () {
+#----------------------------------------------------------
+    my ($self,@in) = @_;
+    my $opts = $self->common_param (@in) or return $self->error("BADCGI","FATAL");
+
+    $self->{sql} = $opts->{sql}; # DB object
+    $self->{cfg} = $opts->{cfg}; # Forum config data
+
+    GetOptions('forum=s' => \$self->{input}->{forum_id}); # get forum ID 
+
+    ($self->{input}->{forum_id}) or return $self->error("BADID","FATAL");
+    (-s STDIN)                   or return $self->error("BADINPUT","FATAL");
+
+    my $mail;
+    {
+        local $/;
+        $mail = <STDIN>;
+    } 
+    $mail =~ s/\r?\n/\n/g;
+
+    my $parser = new GT::Mail::Parse (
+        debug     => $self->{cfg}->{debug_level},
+        in_string => $mail,
+        crlf      => "\n"
+    ) or return $self->error("WARNING","FATAL",$GT::Mail::error);
+
+    $self->{input}->{head}     = $parser->parse;   
+    $self->{input}->{parts}    = $parser->parts;
+    $self->{user}->{user_name} = parse_elem($self->{input}->{head}->get('From'));
+
+    ($self->{user}->{user_name}) or return $self->error("BADUSERNAME","FATAL");
+
+# Create new disabled user
+    $self->create_disabled_user();
+
+#add message
+    $self->insert_message();
+}
+
+sub create_disabled_user {
+#-------------------------------------------------------
+# create new disabled user
+#
+    my $self = shift;
+    my $table = $self->{sql}->table('User');
+    my $rs = $table->select({user_username => $self->{user}->{user_name}})->fetchrow_hashref;
+    if ($rs->{user_username}) {
+        $self->{user}->{user_id} = $rs->{user_id};
+    }
+    else {
+        my $cols = $table->{schema}->{cols};
+        my $fields;
+        $fields->{user_username}    = $self->{user}->{user_name};
+        $fields->{user_email}       = $self->{user}->{user_name};
+        $fields->{user_disp_email}  = $self->{user}->{user_name};
+        $fields->{user_enabled}     = 0;
+        my $sth = $table->insert($fields) or return $self->error("WARNING","FATAL",$GT::SQL::error);
+        $self->{user}->{user_id} = $sth->insert_id;
+    }
+}
+
+sub insert_message {
+#----------------------------------------------------------
+# Insert a message
+#
+    my $self = shift;
+    my $post_time;
+
+    my $head = $self->{input}->{head};
+    my $date = $head->get('Date');
+    ($date) and $post_time = parse_date($date);
+
+    my $table  = $self->{sql}->table('Post');
+    my $fields;    
+    my $body   = $self->get_body();
+
+    my $msgid = $head->get('message-id');
+    $msgid =~ s,[< >],,g;
+
+    $fields->{post_username} = $self->{user}->{user_name};
+    $fields->{user_id_fk}    = $self->{user}->{user_id};
+    $fields->{forum_id_fk}   = $self->{input}->{forum_id};
+    $fields->{post_root_id}  = 0;
+    $fields->{post_father_id}= 0;
+    $fields->{post_depth}    = 0;
+    $fields->{post_time}     = $post_time;
+    $fields->{post_subject}  = $head->get('Subject');
+    $fields->{post_style}    = ($head->effective_type eq 'text/plain') ? 0 : 2;
+    $fields->{post_message}  = $body->{body};
+    $fields->{post_email_id} = $msgid;
+    
+    if ($head->get('received')) {
+        my $received = pop @{$self->get_ip()};
+        $received =~ m/([^\(]*?\d)\)/; 
+        $fields->{post_ip} = $1;        
+    }
+    $fields->{post_ip} ||= '0.0.0.0';    
+
+    my $refid = parse_elem($head->get('references'));
+    if ($refid or $head->{'in-reply-to'}) { #this is a reply to an existing message        
+        my $parent = $self->{sql}->table('Post')->select({ post_email_id => $refid })->fetchrow_hashref;
+        if ($parent) {
+            $fields->{post_root_id}   = $parent->{post_root_id} || $parent->{post_id};
+            $fields->{post_father_id} = $parent->{post_id};
+            $fields->{post_depth}     = $parent->{post_depth} + 1;
+        }
+    }     
+
+    my $table = $self->{sql}->table('Post');
+    my $sth   = $table->insert($fields) or return $self->error("WARNING","FATAL",$GT::SQL::error);    
+    my $post_id = $sth->insert_id;
+
+# add the attachments
+    require GT::TempFile;
+    my $name = new GT::TempFile;    
+    my $path = $$name.'tmp';
+    my $attachments = $body->{attachments}; 
+    if ($#$attachments >=0) {
+        mkdir ($path,0777) or return $self->error("WARNING","FATAL",$!);
+        foreach (@$attachments) {
+            if ($_->{name}) {
+                open (FILE, "> $path/$_->{name}") or return $self->error("WARNING","FATAL",$!);;
+                print FILE $_->{content};
+                close FILE;
+                $table->attach($post_id, "$path/$_->{name}");
+                unlink "$path/$_->{name}";
+            }
+        }
+        rmdir ($path) or return $self->error("WARNING","FATAL",$!);;
+    }
+}
+
+sub get_ip {
+# -------------------------------------------------------------------
+# get IP address
+    my $self = shift;
+    my $received = $self->{input}->{head}->{header_lines}->{received};
+    return if (ref $received ne 'ARRAY');
+    return @$received[0] if ($#$received == 0);
+    return $received;
+}
+
+sub get_body {
+#--------------------------------------------------------------------
+# Parse the body
+#
+    my $self = shift;
+
+    my $head  = $self->{input}->{head};
+    my $parts = $self->{input}->{parts};
+
+    my $type = $head->mime_attr( 'content-type' );
+    my ($body, @attachments);
+
+    if ($type eq 'text/plain' or $type eq 'text/html') {
+        $body = $head->body_as_string;
+    }
+    else {
+        for (@$parts) {
+            my $attach = $_->mime_attr('content-disposition') and $_->mime_attr('content-disposition') eq 'attachment';
+            if ($attach) {
+                my $in = $_->body_in;
+                my $body;
+                if ($in eq 'MEMORY') {
+                    $body = $_->body_data;
+                }
+                elsif ($in eq 'HANDLE') {
+                    $body = $_->body_handle;
+                }
+                elsif ($in eq 'FILE') {
+                    $body = $_->body_path;
+                }
+                ($body) and push @attachments, { name => $_->mime_attr('content-disposition.filename'), content => $body };
+            }
+            elsif ($_->mime_attr('content-type') eq 'text/plain') {
+                $body = $_->body_as_string;
+            }
+            elsif ($_->mime_attr('content-type') ne 'text/html') {
+            #    push @attachments, $_;
+            }
+        }
+        if ( !$body ) {
+            for (@$parts) {
+                next if $_->mime_attr('content-disposition') and $_->mime_attr('content-disposition') eq 'attachment';
+                if ( $_->mime_attr('content-type') eq 'text/html') {
+                    $body = $_->body_as_string;
+                    last;
+                }
+             }
+         }
+         $body ||= '';                 
+    }
+    return { body => $body, attachments => \@attachments};
+}
+
+sub about {
+# -------------------------------------------------------------------
+# Called from the admin, displays a simple help screen.
+#
+    require GT::CGI;
+    my $in = new GT::CGI;
+    print $in->header;
+    print qq~
+<html>
+    <head><title>MailArc Plugin</title>
+    </head>
+    <body bgcolor="#FFFFFF">    
+    <table border="1" cellpadding="0" cellspacing="0"><tr><td>
+      <table bgColor="#ffffff" border="0" cellPadding="3" cellSpacing="3" width="500" valign="top">
+        <tr>
+          <td align="left" bgColor="navy"><b><font color="#ffffff" size="2" face="Tahoma,Arial,Helvetica">MailArc Plugin</font></b></td>
+        </tr>
+        <tr>
+          <td>
+               <p align="center"><b><font color="#000000" size="2" face="Tahoma,Arial,Helvetica">MailArc Plugin</font></b></p>
+               <p><font size="2" face="Tahoma,Arial,Helvetica">
+                This plugin will allow you to use Gossamer Forum as an archive for mailing list.<BR><BR>
+                <b>How do you use MailArc plugin?</b><BR>                   
+               </font></p>
+          </td>
+        </tr>
+      </table>
+      </td></tr>
+    </table>
+    </body>
+    ~;    
+    print qq~
+    </body>
+</html>
+    ~;
+}
+
+sub parse_elem {
+# -------------------------------------------------------------------
+# Return a hash contains name and email from email header if applicable
+    my $value = shift;
+
+    my $result;
+    if ($value =~ /"?([^<"]+)"?\s*<([^>]+)>/) {
+        $result = $2;
+    }
+    elsif ($value =~ /<([^>]+)>/) {
+        $result = $1;
+    }
+    else {
+        $result = $value || '';
+        $result =~ s/\([^)]+\)//g;
+    }
+    return $result;
+}
+
+sub parse_date {
+# -------------------------------------------------------------------
+# Internal use, not usfull from a template.
+# Parse an RFC 822 5.1 compliant date into one understood by mysql.
+# Formats expected:
+#    Sat, 28 Jul 2001 08:44:00 -0700
+#    Sat, 28 Jul 2001 08:44:00 EST
+#    Sat, 28 Jul 2001 08:44:00 "EST"
+#    Sat, 21 Jul 01 19:07:20
+#    28 Jul 2001 14:57:07 -0000
+#    28 Jul 2001 14:57:07 GMT
+#    28 Jul 2001 14:57:07 "GMT"
+#    20 May 01 6:33:30 PM
+#
+# Only the first date is an RFC date, but it appears lots of clients don't
+# use the RFC.
+#
+    my $date = shift;
+    $date || return;
+    chop $date;
+#    $date =~ s/\r//g;
+
+    my $format;
+    CASE: for ($date) {
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d (?:[+-]\d+|\w+)/    and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss% %o%'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d "(?:[+-]\d+|\w+)"/  and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss% "%o%"'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d  (?:[+-]\d+|\w+)/   and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss%  %o%'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d  "(?:[+-]\d+|\w+)"/ and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss%  "%o%"'; last CASE };
+        /\w+, \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d/                    and do { $format = '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:%ss%'; last CASE };
+        /\w+, \d\d? \w+ \d{2} \d?\d:\d?\d:\d\d/                    and do { $format = '%ddd%, %dd% %mmm% %yy% %HH%:%MM%:%ss%'; last CASE };
+        
+        /\w+,  \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d (?:[+-]\d+|\w+)/   and do { $format = '%ddd%,  %dd% %mmm% %yyyy% %HH%:%MM%:%ss% %o%'; last CASE };
+        /\w+,  \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d "(?:[+-]\d+|\w+)"/ and do { $format = '%ddd%,  %dd% %mmm% %yyyy% %HH%:%MM%:%ss% "%o%"'; last CASE };
+        /\w+,  \d\d? \w+ \d{4} \d?\d:\d?\d:\d\d/                   and do { $format = '%ddd%,  %dd% %mmm% %yyyy% %HH%:%MM%:%ss%'; last CASE };
+        /\w+,  \d\d? \w+ \d{2} \d?\d:\d?\d:\d\d/                   and do { $format = '%ddd%,  %dd% %mmm% %yy% %HH%:%MM%:%ss%'; last CASE };
+
+        /\d\d? \w+ \d{4} \d?\d:\d?\d:\d\d (?:[+-]\d+|\w+)/         and do { $format = '%dd% %mmm% %yyyy% %HH%:%MM%:%ss% %o%'; last CASE };
+        /\d\d? \w+ \d{4} \d?\d:\d?\d:\d\d "(?:[+-]\d+|\w+)"/       and do { $format = '%dd% %mmm% %yyyy% %HH%:%MM%:%ss% "%o%"'; last CASE };
+        /\d\d? \w+ \d{4} \d?\d:\d?\d:\d\d  (?:[+-]\d+|\w+)/        and do { $format = '%dd% %mmm% %yyyy% %HH%:%MM%:%ss%  %o%'; last CASE };
+        /\d\d? \w+ \d{4} \d?\d:\d?\d:\d\d  "(?:[+-]\d+|\w+)"/      and do { $format = '%dd% %mmm% %yyyy% %HH%:%MM%:%ss%  "%o%"'; last CASE };
+        /\d\d? \w+ \d{2} \d?\d:\d?\d:\d\d [AaPpMm]{2}/             and do { $format = '%dd% %mmm% %yy% %hh%:%MM%:%ss% %tt%'; last CASE };
+    }
+    $format or return;
+    return timelocal(parse_format($date, $format));
+}
+1;
+
+</textarea></p>
+    </form>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">Simply cut and paste the
+    above code into the edit box, and hit update. To make sure everything is
+    correct, you can click on Perl Check to run a syntax check on it. Try it and
+    you should see
+    'MailArc.pm syntax ok'.</font></p>
+    <p><font face="Tahoma,Arial,Helvetica" size="2">A couple things to note about
+    the code:</font></p>
+    <table border="0" cellpadding="2" width="80%">
+      <tr>
+        <td valign="top">
+          <pre>package Plugins::GForum::MailArc;</pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">Don't forget to put
+          your code inside the proper package or it will never work.</font></td>
+      </tr>
+      <tr>
+        <td valign="top"><pre>use strict; </pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">Always, always run your
+          plugins under use strict. If you want your plugin to be mod_perl
+          compatible, this will be essential.</font></td>
+      </tr>      
+      <tr>
+        <td valign="top">
+          <pre>use GT::Mail::Parse;</pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">This module lets you
+          parse the contents of an email.</font></td>
+      </tr>      
+      <tr>
+        <td valign="top">
+          <pre>use GT::Date qw/timelocal parse_format/;</pre>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">GT::Date provides several functions useful in parsing dates, and 
+doing date manipulation.</font></td>
+      </tr>  
+      <tr>
+        <td valign="top">
+          <font face="Tahoma,Arial,Helvetica" size="2">1;</font>
+        </td>
+        <td valign="top"><font face="Tahoma,Arial,Helvetica" size="2">Don't forget, all
+          module must end with a 1; or they won't be able to get require'd in
+          properly.</font></td>
+      </tr>
+    </table>
+<p><font face="Tahoma,Arial,Helvetica" size="2"><b>Step 10: All Done, try it
+out!<br>
+    </b>Now, we are all done! Click on Plugin Manager and it should be listed as
+a plugin waiting to be installed. Click on Install and you should now be able to
+try it out!</font></p>
+    </td>
+  </tr>
+</table>
+
+<TABLE width=100%>
+<TR>
+<TD align="right" valign="top">
+<B><a href="admin.cgi?do=help&topic=help_toc.html"><font face="Verdana, Arial, Helvetica" size="2">Table
+of Contents</font></a></B>
+<HR>
+</TD>
+</TR>
+</TABLE>
+
+</body>
+
Index: admin/help/help_setup.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/help/help_setup.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -u -r1.1 -r1.2
--- admin/help/help_setup.html  11 Oct 2001 22:28:01 -0000      1.1
+++ admin/help/help_setup.html  10 Jan 2002 09:02:19 -0000      1.2
@@ -34,9 +34,9 @@
       files and resources.</font></p>^M
     </blockquote>^M
     <p><font size="2" face="Tahoma, Arial, Helvetica">&nbsp;</font></p>^M
-    <p><font size="4" face="Tahoma, Arial, Helvetica"><u>Default</u></font></p>^M
+    <p><font size="4" face="Tahoma, Arial, Helvetica"><u>Defaults</u></font></p>^M
     <blockquote>^M
-      <p><font size="2" face="Tahoma, Arial, Helvetica">The &quot;Default&quot;^M
+      <p><font size="2" face="Tahoma, Arial, Helvetica">The &quot;Defaults&quot;^M
       options allow you to configure the default settings which will be used^M
       when your forum is viewed.</font></p>^M
     </blockquote>^M
@@ -88,13 +88,6 @@
       <p><font size="2" face="Tahoma, Arial, Helvetica">The &quot;Email&quot;^M
       options allow you to configure how outgoing emails from the forum admin^M
       will be sent.</font></p>^M
-    </blockquote>^M
-    <p><font size="2" face="Tahoma, Arial, Helvetica">&nbsp;</font></p>^M
-    <p><font size="4" face="Tahoma, Arial, Helvetica"><u>Dates</u></font></p>^M
-    <blockquote>^M
-      <p><font size="2" face="Tahoma, Arial, Helvetica">The &quot;Dates&quot;^M
-      options allow you to configure how dates will be displayed throughout your^M
-      forum.</font></p>^M
     </blockquote>^M
     <p><font size="2" face="Tahoma, Arial, Helvetica">&nbsp;</font></p>^M
     <p><font size="4" face="Tahoma, Arial, Helvetica"><u>Actions</u></font></p>^M
Index: admin/help/help_templates.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/help/help_templates.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -r1.4 -r1.5
--- admin/help/help_templates.html      19 Oct 2001 23:31:01 -0000      1.4
+++ admin/help/help_templates.html      10 Jan 2002 09:02:19 -0000      1.5
@@ -53,7 +53,7 @@

     <p>&nbsp;</p>
     <p><u><font face="Tahoma, Arial, Helvetica" size="4">Language
-    Variables</font></u></p>
+    Vars</font></u></p>
     <blockquote>
       <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking
       "Language Variables" displays a menu allowing you to view and
@@ -81,7 +81,7 @@
     </blockquote>
     <p><font face="Tahoma, Arial, Helvetica" size="2">&nbsp;</font></p>
     <p><u><font face="Tahoma, Arial, Helvetica" size="4">Global
-    Variables</font></u></p>
+    Vars</font></u></p>
     <blockquote>
       <p><font face="Tahoma, Arial, Helvetica" size="2">Clicking
       "Global Variables" displays a menu allowing you to view and edit
Index: admin/help/help_toc.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/help/help_toc.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -u -r1.1 -r1.2
--- admin/help/help_toc.html    11 Oct 2001 22:28:01 -0000      1.1
+++ admin/help/help_toc.html    10 Jan 2002 09:02:19 -0000      1.2
@@ -21,7 +21,15 @@
        <a href="admin.cgi?do=help;topic=help_admin.html">Your Admin</a>^M
     <blockquote>^M
     <p><a href="admin.cgi?do=help;topic=help_home.html">Home</a></p>^M
-    <p><a href="admin.cgi?do=help;topic=help_forums.html">Forums</a><p><a href="admin.cgi?do=help;topic=help_posts.html">Posts</a><p><a href="admin.cgi?do=help;topic=help_users.html">Users</a><p><a href="admin.cgi?do=help;topic=help_markup.html">Markup</a><p><a href="admin.cgi?do=help;topic=help_templates.html">Templates</a><p><a href="admin.cgi?do=help;topic=help_email.html">Email</a><p><a href="admin.cgi?do=help;topic=help_plugins.html">Plugins</a><p><a href="admin.cgi?do=help;topic=help_setup.html">Setup</a>^M
+    <p><a href="admin.cgi?do=help;topic=help_forums.html">Forums</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_posts.html">Posts</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_users.html">Users</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_markup.html">Markup</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_templates.html">Templates</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_email.html">Email</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_plugins.html">Plugins</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_tools.html">Tools</a></p>^M
+    <p><a href="admin.cgi?do=help;topic=help_setup.html">Setup</a></p>^M
     </blockquote>^M
     <p><a href="admin.cgi?do=help;topic=help_templates_guide.html">Templates</a>^M
     <blockquote>^M
Index: admin/help/help_users.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/admin/help/help_users.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -r1.2 -r1.3
--- admin/help/help_users.html  19 Oct 2001 20:07:29 -0000      1.2
+++ admin/help/help_users.html  10 Jan 2002 09:02:19 -0000      1.3
@@ -31,32 +31,6 @@
       Code&quot; and &quot;Email&quot; fields cannot be left blank.</font></p>
     </blockquote>
     <ul>
-      <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">Modify</font></u></b></li>
-    </ul>
-    <blockquote>
-      <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the
-      &quot;Modify&quot; link brings up a form allowing you to search for
-      specific user records to modify.&nbsp; Enter criteria for your search and
-      click the &quot;Search User&quot; button.&nbsp; A page with the results of
-      your search will be displayed.&nbsp; Select a user record to modify by
-      clicking the radio button beside it and clicking the &quot;Modify
-      User&quot; button.&nbsp; A form allowing you to change any or all aspects
-      of that user record will be displayed.</font></p>
-    </blockquote>
-    <ul>
-      <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">Delete</font></u></b></li>
-    </ul>
-    <blockquote>
-      <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the
-      &quot;Delete&quot; link brings up a form allowing you to search for
-      specific user record to delete.&nbsp; Enter criteria for your search and
-      click the &quot;Search User&quot; button.&nbsp; A page with the results of
-      your search will be displayed.&nbsp; Select a user record to delete by
-      clicking the checkbox beside it and clicking the &quot;Delete User&quot;
-      button.&nbsp;</font></p>
-    </blockquote>
-
-<ul>
       <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">Validate</font></u></b></li>
     </ul>
     <blockquote>
@@ -72,14 +46,14 @@
       &quot;Search&quot; link brings up a form allowing you to search for
       specific user record.&nbsp; Enter criteria for your search and click the
       &quot;Search User&quot; button.&nbsp; A page with the results of your
-      search will be displayed.&nbsp;</font></p>
+      search will be displayed. You can choose to view the "Details" of, "Modify" or "Delete" any of the records returned by your search by clicking on the appropriate link.&nbsp;</font></p>
     </blockquote>
     <ul>
-      <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">List</font></u></b></li>
+      <li><b><u><font size="2" face="Tahoma,Arial,Helvetica">List All</font></u></b></li>
     </ul>
     <blockquote>
       <p><font size="2" face="Tahoma,Arial,Helvetica">Clicking the
-      &quot;List&quot; link displays a detailed list of all user records in your
+      &quot;List All&quot; link displays a detailed list of all user records in your
       database.&nbsp; A shorter summary of all user records can be viewed by
       clicking the &quot;condensed&quot; link.</font></p>
     </blockquote>
@@ -143,7 +117,7 @@
     <blockquote>
       <p><font face="Tahoma,Arial,Helvetica" size="2">Clicking the &quot;Add
       Users&quot; link brings up a form allowing you to add users to any of your
-      database's user groups.</font></p>
+      database's user groups. Select the appropriate group from the drop-down menu, then enter usernames in the main text field, one per line.</font></p>
     </blockquote>
     <ul>
       <li><b><u><font face="Tahoma,Arial,Helvetica" size="2">Remove Users</font></u></b></li>
@@ -151,7 +125,7 @@
     <blockquote>
       <p><font face="Tahoma,Arial,Helvetica" size="2">Clicking the &quot;Remove
       Users&quot; link brings up a form allowing you to remove users from any of
-      your database's user groups.</font></p>
+      your database's user groups. Select the appropriate group from the drop-down menu and click the "select users" button.  You can enter usernames in the main text field, one per line, or click the "View user select list" to see a list of all users in the selected group.  Usernames can be selected and deleted from this list.</font></p>
     </blockquote>
     <p>&nbsp;</p>
     <p><u><font size="4" face="Tahoma,Arial,Helvetica">Bans</font></u></p>
Index: common/README
===================================================================
RCS file: common/README
diff -N common/README
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ common/README       10 Jan 2002 09:02:09 -0000      1.1
@@ -0,0 +1 @@
+Note! Do not edit these templates. You should use the template editor in the admin, which saves changes in the local directory. This allows you to recover old templates if you accidentally mess up a template, or compare your customized templates to the original template.
Index: common/editor.js
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/common/editor.js,v
retrieving revision 1.3
retrieving revision 1.7
diff -b -u -r1.3 -r1.7
--- common/editor.js    18 Dec 2001 18:21:43 -0000      1.3
+++ common/editor.js    11 Jan 2002 23:18:19 -0000      1.7
@@ -1,975 +1,456 @@
 /*
  * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
+ * HTML Editor - A wysiwyg web based editor for IE5.5+
  *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor.js,v 1.3 2001/12/18 18:21:43 sbeck Exp $
+ *    Revision : $Id: editor.js,v 1.7 2002/01/11 23:18:19 jagerman Exp $
  *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
+ * Copyright (c) 2002 Gossamer Threads Inc. All Rights Reserved.
  * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
+ * see LICENSE file for full details.
  * =================================================================
  *
- * Description: Public interface for creating an HTML editor.
+ * Description: Common functions needed to display the toolbar for an
+ * HTML-editing iframe, as used in Gossamer Forum.
  */

-// Keep track of number of images loaded.
-IMAGES_LEN = 0;
+/* -- Javascript needed to write a post -- */
+
+var url = window.location.protocol + '//' + window.location.hostname + window.location.pathname + '?<%hidden_query%>';

-// All the files. Used to set the url to them.
-FILES = {
-    image  : "image.html",
-    about  : "about.html"
+var image_url = '<%escape_js image_url%>';
+
+var Faces = {
+    ':)'      : image_url + '/smile.gif',
+    ';)'      : image_url + '/wink.gif',
+    ':('      : image_url + '/frown.gif',
+    ':P'      : image_url + '/tongue.gif',
+    'cool'    : image_url + '/cool.gif',
+    'blush'   : image_url + '/blush.gif',
+    'angelic' : image_url + '/angelic.gif',
+    'crazy'   : image_url + '/crazy.gif',
+    'mad'     : image_url + '/mad.gif',
+    'shocked' : image_url + '/shocked.gif',
+    'laugh'   : image_url + '/laugh.gif',
+    ':/'      : image_url + '/unsure.gif',
+    ':|'      : image_url + '/unimpressed.gif',
+    'sly'     : image_url + '/sly.gif',
+    'pirate'  : image_url + '/pirate.gif'
 };

-// Have to store "this" in a global for events that are fired.
-// This gives a limitation that only one instance of the 
-// Editor can occur. This seems quite lame to me. If JScript
-// had support for closures there would not be a problem.
-This = false;
+var iframe, editor, post, outerdoc; // iframe is the inner iframe, editor is the editor (document object), and post is the editor's body.

+var innerInterval, tbInterval, pressedInterval, initialized;

-/***********************************************************/
-/***********************************************************/
-/************ Public Fucntions                  ************/
-/***********************************************************/
-/***********************************************************/
+window.onresize = tb_layout;

-function Editor (opts) {
-/* ---------------------------------------------------------
- * Constructor for Editor. Pass in an Object or options
- * for this instance of the editor.
- * Example:
- *    var editor = new Editor (
- *        { 
- *            debug      : 1, 
- *            base_url   : "http://www.gossamer-threads.com/tmp/editor"
- *        }
- *    );
- * 
- */
-    this.debug ("Got to constructor Editor");
-    if (!opts) return this;
-    var initialize = false;
-    this.initialized = false;
-    this.tb_hide = {};
-    this.tb_delete = {};
-    this.control = DHTMLSafe;
-    for (var opt in opts) {
-        switch (opt) {
-            case "tb_hide":
-                for (var i = 0; i < opts[opt].length; i++) {
-                    this.tb_hide[opts[opt][i]] = 1;
-                }
-                break;
-            case "tb_delete":
-                for (var i = 0; i < opts[opt].length; i++) {
-                    this.tb_delete[opts[opt][i]] = 1;
-                }
-                break;
-            case "base_url":
-                this.base_url = opts[opt];
-                break;
-            case "image_url":
-                this.image_url = opts[opt];
-                break;
-            case "images_url":
-                this.images_url = opts[opt];
-                break;
-            case "debug":
-                this.set_debug_level (opts[opt]);
-                break;
-            case "init":
-                initialize = true;
-                break;
-            default:
-                return this.error ("In constructure for Editor wrong argument");
-                break;
-        }
-    }
+function initOuterIFrame () {
+    // How fun - we write the HTML (which includes JavaScript) for this iframe, then write the HTML for the iframe contained within the iframe. :)
+    document.frames.editor_iframe.document.write('<%GForum::Utils::js_quote_include('editor_iframe.html')%>');

-// go through and set all the urls
-    for (var file in FILES) {
-        if (this[file + "_url"]) continue;
-        if (this.base_url) {
-            this[file + "_url"] = this.base_url + FILES[file];
+    innerInterval = setInterval("initInnerIFrame()", 100);
+}
+
+function initInnerIFrame () {
+    if (document.frames.editor_iframe.document.editor_iframe) { // The inner <iframe> exists
+        clearInterval(innerInterval);
         }
         else {
-            this[file + "_url"] = FILES[file];
+        return; // The inner <iframe> hasn't been loaded yet
         }
+    outerdoc = document.frames.editor_iframe.document;
+    iframe = outerdoc.frames.editor_iframe;
+    editor = iframe.document;
+
+    var initValue;
+    if (privateMessage) {
+        initValue = document.message.msg_body_html.value;
     }
-// Set some defaults
-
-// State we are in.
-    this.text_mode    = false;
-
-// Initial html.
-    this.editor_content = '';
-
-// The editor is initialized
-    this.editor_init  = false;
-
-// The toolbar is initialized
-    this.toolbar_init = false;
-
-// Images initialized
-    this.images_init  = false;
+    else {
+        initValue = document.post.post_message_html.value;
+    }
+    editor.write('<%GForum::Utils::js_quote_include('editor_editor.html')%>' + initValue + '</body></html>');

-// Array of toolbars
-    this.toolbars     = [];
+    post = editor.all.post;

-    This = this;
-    if (initialize) this.init();
-    return this;
-}
+    tbInterval = setInterval("toolbarInit()", 100);

-function get_editor_html () {
-/* ---------------------------------------------------------
- * Gets the html when the user is done editing it. Html 
- * returned should be sutible for a web page.
- */
-    var ret;
-    ret = DHTMLSafe.DocumentHTML;
-    return ret;
-}
-Editor.prototype.get_editor_html = get_editor_html;
+    if (privateMessage) {
+        document.message.onsubmit = retrieveHTML;
+    }
+    else {
+        document.post.onsubmit = retrieveHTML;
+    }

-function set_editor_html (content) {
-/* ---------------------------------------------------------
- * Set the html for the document. String passed in must be
- * somewhat valid html.
- */
-// Set the content
-    this.editor_content = content;
-    return true;
+    pressedInterval = setInterval("calcPressed()", 300);
 }
-Editor.prototype.set_editor_html = set_editor_html;

-function set_debug_level (debug) {
-/* ---------------------------------------------------------
- * Gets the html when the user is done editing it. Html 
- * returned should be sutible for a web page.
- */
-    if (debug || debug == 0) this._debug = debug;
-    if (this._debug > 0) this.debug_init();
-
-    return this._debug;
+function press (button, image) { // Takes a span from the outer iframe and "presses" it.
+    button.isPressed = true;
+    button.className = "menu_item_mouseoverdown";
+    image.className  = "icon_down";
 }
-Editor.prototype.set_debug_level = set_debug_level;

-/***********************************************************/
-/***********************************************************/
-/************ Error handling and Debugging      ************/
-/***********************************************************/
-/***********************************************************/
-
-function error () {
-/* ---------------------------------------------------------
- * Called for errors. Alerts the error and returns false.
- * Nice for syntax like return this.error ("Some is wrong");
- */
-    var msg = '';
-    for (var i = 0; i < arguments.length; i++) msg += ' ' + arguments[i];
-    if (this._debug > 0) this.debug (msg);
-    alert ("Editor: " + msg);
-    return false;
+function unpress (button, image) { // Takes one of the spans from the editor_iframe page and unpresses the button
+    button.isPressed = false;
+    button.className = "tb_menu_item";
+    image.className  = "tb_icon";
 }
-Editor.prototype.error = error;

-function debug () {
-/* ---------------------------------------------------------
- * Debuggin routine. FIXME: Escape html character.
- */
-    var msg = '';
-    for (var i = 0; i < arguments.length; i++) msg += ' ' + arguments[i];
-    if (this._debug > 0 && this.dh) this.dh.writeln ("Editor: " + msg);
-    return true;
+function disable (button) { // Disables a span
+       button.className  = "tb_menu_item";
+    button.disabled = true;
+    button.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0, opacity=25)";
 }
-Editor.prototype.debug = debug;
-
-
-/***********************************************************/
-/***********************************************************/
-/************ Init functions                    ************/
-/***********************************************************/
-/***********************************************************/
-
-function init_start () {
-/* ---------------------------------------------------------
- * Initializes the toolbar and images. Public function
- * to start everything after options are passed in.
- */
-
-    // Display everything at once.
-    this.debug ("Init start called");
-    this.debug ("Setting interval");
-    this.time_out = window.setInterval ("This.window_init()", 1000, 'JScript');
-
-// Initialize images and toolbar
-    this.debug ("Calling init_images");
-    this.init_images ();
-    this.debug ("Calling init_toolbar");
-    this.init_toolbar ();
-    this.debug ("Done with init_start");
-    this.initialized = true;

+function enable (button) { // Enables a span
+    button.disabled = false;
+    button.style.filter = null;
 }
-Editor.prototype.init = init_start;

-function debug_init () {
-/* ---------------------------------------------------------
- * Initializes the debugging window and sets up an event
- * handler to close it.
- */
-    if (this._debug) {
-        var win = window.open ("", "debug_win", "");
-        this.dh = win.document;
-        this.debug_win = win;
-        this.dh.write ("<html><pre>");
-        window.onunload = function () { This.debug_win.close() };
-    }
-}
-Editor.prototype.debug_init = debug_init;
+var pressLoopInit = false;
+var pressButtons = {};
+var pressLoop = [];
+function calcPressed () {
+    var sel = editor.selection.createRange();

-function window_init () {
-/* ---------------------------------------------------------
- * Sets the display on all toolbars to visible. Returns
- * if anything has not been initalized
- */
-// Toolbar and images have been initialized
-    if (!this.toolbar_init || !this.images_init) return;
+    if (!pressLoopInit) {
+        pressLoop[pressLoop.length] = 'Bold';
+        pressButtons['Bold'] = [outerdoc.all.bold, outerdoc.all.boldImage];

-// All images are loaded
-    if (IMAGES_LEN < document.images.length) return;
+        pressLoop[pressLoop.length] = 'Italic';
+        pressButtons['Italic'] = [outerdoc.all.italic, outerdoc.all.italicImage];

-    this.debug ("Initializing Window display");
+        pressLoop[pressLoop.length] = 'Underline';
+        pressButtons['Underline'] = [outerdoc.all.underline, outerdoc.all.underlineImage];

-// Clear the timeout
-    this.debug ("Clearing interval");
-    window.clearInterval (this.time_out);
+        pressLoop[pressLoop.length] = 'JustifyLeft';
+        pressButtons['JustifyLeft'] = [outerdoc.all.jleft, outerdoc.all.jleftImage];

-    this.debug ("Going through images array");
-    for (var i = 0; i < document.images.length; i++) {
-        var image = document.images[i];
+        pressLoop[pressLoop.length] = 'JustifyCenter';
+        pressButtons['JustifyCenter'] = [outerdoc.all.jcenter, outerdoc.all.jcenterImage];

+        pressLoop[pressLoop.length] = 'JustifyRight';
+        pressButtons['JustifyRight'] = [outerdoc.all.jright, outerdoc.all.jrightImage];

-// Do not show images that have been deleted in the toolbar
-        var tb = image.parentElement.parentElement.title;
-        if (this.tb_delete[tb]) continue;
+        pressLoop[pressLoop.length] = 'InsertOrderedList';
+        pressButtons['InsertOrderedList'] = [outerdoc.all.ol, outerdoc.all.olImage];

-        document.images[i].style.visibility = 'visible';
-    }
+        pressLoop[pressLoop.length] = 'InsertUnorderedList';
+        pressButtons['InsertUnorderedList'] = [outerdoc.all.ul, outerdoc.all.ulImage];

-// Display toolbar
-    this.debug ("Going through toobar array");
-    for (var i = 0; i < this.toolbars.length; i++) {
-        this.debug ("Setting toolbar", this.toolbars[i].title, "to visible");
-        if (this.toolbars[i].className == 'toolbar_hidden') continue;
-        this.toolbars[i].style.visibility = 'visible';
+        pressLoopInit = true;
     }
-    this.debug ("Setting dhtml content");
-    if ( this.editor_content ) DHTMLSafe.DocumentHTML = this.editor_content;

-    this.debug ("Finished windows init");
-    return true;
-}
-Editor.prototype.window_init = window_init;
-
-
-/***********************************************************/
-/***********************************************************/
-/************ Execute DHTML Commands            ************/
-/***********************************************************/
-/***********************************************************/
-
-function exec (what, prompt, opt) {
-/* ---------------------------------------------------------
- * General method to Execute a command to edit.
- * Options are "Command", "Prompt user", 
- * "options for command" . The first two are constants 
- * defined at the top. The last is any options the command
- * needs. This function validates against text mode and 
- * runs a Query to see if the command can happen. If the
- * can't be ran, returns false.
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
+    for (var i = 0; i < pressLoop.length; i++) {
+        var pressed = sel.queryCommandValue(pressLoop[i]);
+        var span  = pressButtons[pressLoop[i]][0];
+        var image = pressButtons[pressLoop[i]][1];

-    if (!opt)     opt = '';
-    if (!prompt)  prompt = OLECMDEXECOPT_DODEFAULT;
-
-// Do whatever it is we are doing
-    var ret = this.query (what);
-    switch (ret) {
-        case 0:
-            //alert ("Command not supported");
-            this.debug ("Command", what, "not supported");
-            break;
-        case 1:
-            //alert ("Command disabled (" + what + ")");
-            this.debug ("Command", what, "disabled");
-            break;
-        default:
-            this.debug ("Calling ExecCommand with arguments", what, prompt, opt);
-            DHTMLSafe.ExecCommand(what, prompt, opt);
-            DHTMLSafe.focus();
-            return true;
+        if      (pressed && !span.isPressed)   press(span, image);
+        else if (!pressed && span.isPressed) unpress(span, image);
+        else if (span.isPressed == null) span.isPressed = false;
     }
-    DHTMLSafe.focus();
-    return false;
-}
-Editor.prototype.exec = exec;
-
-function query (what) {
-    return DHTMLSafe.QueryStatus (what)
-}
-Editor.prototype.query = query;
-
-/***********************************************************/
-/***********************************************************/
-/************ Utility Function                  ************/
-/***********************************************************/
-/***********************************************************/
-
-function update_toggle (element, image) {
-/* ---------------------------------------------------------
- * Updates a toggle button given the parent element and
- * the image object.
- */

-// Turn it off
-    if (element.tb_state == 'on') {
-        element.tb_state  = 'off';
-        element.className = "tb_menu_item";
-        image.className   = "tb_icon";
-    }
+    var cutable = sel.queryCommandEnabled('Cut');
+    var copyable = sel.queryCommandEnabled('Copy');
+    var pastable = sel.queryCommandEnabled('Paste');
+    var linkable = (sel.htmlText != '' && sel.htmlText != '\n<P>&nbsp;</P>');

-// Turn it off
-    else if (element.tb_state == 'off') {
-        element.tb_state = 'on';
-        element.className = "menu_item_mouseoverdown";
-        image.className   = "icon_down";
-    }
+    if      ( cutable  &&  outerdoc.all.cut.disabled  ) enable (outerdoc.all.cut  );
+    else if (!cutable  && !outerdoc.all.cut.disabled  ) disable(outerdoc.all.cut  );
+    if      ( copyable &&  outerdoc.all.copy.disabled ) enable (outerdoc.all.copy );
+    else if (!copyable && !outerdoc.all.copy.disabled ) disable(outerdoc.all.copy );
+    if      ( pastable &&  outerdoc.all.paste.disabled) enable (outerdoc.all.paste);
+    else if (!pastable && !outerdoc.all.paste.disabled) disable(outerdoc.all.paste);
+    if      ( linkable &&  outerdoc.all.link.disabled ) enable (outerdoc.all.link );
+    else if (!linkable && !outerdoc.all.link.disabled ) disable(outerdoc.all.link );
 }
-Editor.prototype.update_toggle = update_toggle;
-
-function cancel_event (evnt) {
-/* ---------------------------------------------------------
- * General function to cancel an event.
- */
-    if (!evnt) evnt = event;
-    if (!evnt) return false;
-    evnt.returnValue  = false;
-    evnt.cancelBubble = true;
-    return false;
-}
-Editor.prototype.cancel_event = cancel_event;
-
-/* 
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor.js,v 1.3 2001/12/18 18:21:43 sbeck Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: DHTML Editing Component Constants for JavaScript
- * Constants (c) Microsoft Corporation.
- */

-//
-// Command IDs
-//
-DECMD_BOLD =                      5000
-DECMD_COPY =                      5002
-DECMD_CUT =                       5003
-DECMD_DELETE =                    5004
-DECMD_DELETECELLS =               5005
-DECMD_DELETECOLS =                5006
-DECMD_DELETEROWS =                5007
-DECMD_FINDTEXT =                  5008
-DECMD_FONT =                      5009
-DECMD_GETBACKCOLOR =              5010
-DECMD_GETBLOCKFMT =               5011
-DECMD_GETBLOCKFMTNAMES =          5012
-DECMD_GETFONTNAME =               5013
-DECMD_GETFONTSIZE =               5014
-DECMD_GETFORECOLOR =              5015
-DECMD_HYPERLINK =                 5016
-DECMD_IMAGE =                     5017
-DECMD_INDENT =                    5018
-DECMD_INSERTCELL =                5019
-DECMD_INSERTCOL =                 5020
-DECMD_INSERTROW =                 5021
-DECMD_INSERTTABLE =               5022
-DECMD_ITALIC =                    5023
-DECMD_JUSTIFYCENTER =             5024
-DECMD_JUSTIFYLEFT =               5025
-DECMD_JUSTIFYRIGHT =              5026
-DECMD_LOCK_ELEMENT =              5027
-DECMD_MAKE_ABSOLUTE =             5028
-DECMD_MERGECELLS =                5029
-DECMD_ORDERLIST =                 5030
-DECMD_OUTDENT =                   5031
-DECMD_PASTE =                     5032
-DECMD_REDO =                      5033
-DECMD_REMOVEFORMAT =              5034
-DECMD_SELECTALL =                 5035
-DECMD_SEND_BACKWARD =             5036
-DECMD_BRING_FORWARD =             5037
-DECMD_SEND_BELOW_TEXT =           5038
-DECMD_BRING_ABOVE_TEXT =          5039
-DECMD_SEND_TO_BACK =              5040
-DECMD_BRING_TO_FRONT =            5041
-DECMD_SETBACKCOLOR =              5042
-DECMD_SETBLOCKFMT =               5043
-DECMD_SETFONTNAME =               5044
-DECMD_SETFONTSIZE =               5045
-DECMD_SETFORECOLOR =              5046
-DECMD_SPLITCELL =                 5047
-DECMD_UNDERLINE =                 5048
-DECMD_UNDO =                      5049
-DECMD_UNLINK =                    5050
-DECMD_UNORDERLIST =               5051
-DECMD_PROPERTIES =                5052
-
-//
-// Enums
-//
-
-// OLECMDEXECOPT  
-OLECMDEXECOPT_DODEFAULT =         0 
-OLECMDEXECOPT_PROMPTUSER =        1
-OLECMDEXECOPT_DONTPROMPTUSER =    2
-
-// DHTMLEDITCMDF
-DECMDF_NOTSUPPORTED =             0 
-DECMDF_DISABLED =                 1 
-DECMDF_ENABLED =                  3
-DECMDF_LATCHED =                  7
-DECMDF_NINCHED =                  11
-
-// DHTMLEDITAPPEARANCE
-DEAPPEARANCE_FLAT =               0
-DEAPPEARANCE_3D =                 1 
-
-// OLE_TRISTATE
-OLE_TRISTATE_UNCHECKED =          0
-OLE_TRISTATE_CHECKED =            1
-OLE_TRISTATE_GRAY =               2
-
-/*  
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor.js,v 1.3 2001/12/18 18:21:43 sbeck Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: Editing and format functions.
- */
-
-/***********************************************************/
-/***********************************************************/
-/************ HTML Insertion Functions          ************/
-/***********************************************************/
-/***********************************************************/
-
-function insert_html (start, stop) {
-/* ---------------------------------------------------------
- * If called with "start" and "stop" gets the text that
- * is selected in the edit field and pastes "start" on the
- * left of it an "stop" on the right of it. 
- * Like: <textarea> and </textarea>
- * If called is only "start" replaces the selected text with
- * "start".
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-       var selection = DHTMLSafe.DOM.selection.createRange();
-       if (!start) return;
-       if (selection.htmlText == null) {
-               this.debug ("Can't insert html (", start, stop, "). Selection is null");
-               DHTMLSafe.focus();
-               return;
-       }
-       var html = '';
-       if (stop) {
-               this.debug ("Inserting html (", start, stop, ") around (", selection.text, ")");
-               html = start + selection.text + stop;
+function retrieveHTML () {
+    if (privateMessage) {
+        document.message.msg_body.value = post.innerHTML;
        }
        else {
-               this.debug ("Inserting html (", html, ")");
-               html = start;
+        document.post.post_message.value = post.innerHTML;
        }
-       if (this.text_mode) html = escape_html (html);
-       selection.pasteHTML (html);
-       DHTMLSafe.focus();
 }
-Editor.prototype.insert_html = insert_html;

-function insert_image () {
-/* ---------------------------------------------------------
- * Calles a pop-up diaglog "IMAGE_URL" to prompt the user to
- * select a URL to an image. After that inserts the image 
- * into the document by calling insert_html.
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-       if (DHTMLSafe.DOM.selection.type == 'Control') {
-               this.debug ("Type of selection is Control. Deselection");
-               DHTMLSafe.DOM.selection.empty();
-       }
-       this.debug ("Bringging up dialogue for URL: (", this.image_url, ")");
-    var src = showModalDialog( this.image_url, this, "dialogHeight:170px;dialogWidth:435px" );
-    if ( src ) this.insert_html( '<img src="' + src + '">' );
+function command (cmd) {
+    iframe.focus();
+    editor.execCommand(cmd);
+    iframe.focus();
 }
-Editor.prototype.insert_image = insert_image;

-function insert_hr () {
-/* ---------------------------------------------------------
- * Inserts the html needed for an hr
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('hr')%>
-    this.insert_html( '<%escape_js hr%><br>' )
+function addTag (face) {
+    iframe.focus();
+    editor.selection.createRange().pasteHTML('<img src="' + Faces[face] + '">');
+    iframe.focus();
 }
-Editor.prototype.insert_hr = insert_hr;

-function insert_quote () {
-/* ---------------------------------------------------------
- * Inserts the html needed for a quote
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('quote', '/quote')%>
-    var start = '<%escape_js quote%><br>';
-    var end   = '<%escape_js /quote%>';
-    this.insert_html( start, end );
+// This handles the tabbing - if you change the post icon selection, the
+// tabIndex needs to be changed as well so that we don't have to tab through all
+// of the icons if going through the page with tab
+function updateTab (selected_val) {
+  var col = document.getElementsByName("post_icon");
+  for (i = 0; i < col.length; i++) {
+    if (selected_val == col[i].value)
+      col[i].tabIndex = 5;
+    else
+      col[i].tabIndex = 0;
+  }
 }
-Editor.prototype.insert_quote = insert_quote;

-function insert_reply () {
-/* ---------------------------------------------------------
- * Inserts the html needed for a reply
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('reply', '/reply')%>
-    var start = '<%escape_js reply%><br>';
-    var end   = '<%escape_js /reply%>';
-    this.insert_html( start, end );
+function command (cmd) {
+    editor.execCommand(cmd);
+    iframe.focus();
 }
-Editor.prototype.insert_reply = insert_reply;

-function insert_code () {
-/* ---------------------------------------------------------
- * Inserts the html needed for a code
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('code', '/code')%>
-    var start = '<%escape_js code%><br>';
-    var end   = '<%escape_js /code%>';
-    this.insert_html( start, end );
+// This is called for things like [quote]...[/quote] - they should surround the selected text.
+function surroundTag (start, end) {
+    iframe.focus();
+    var selection = editor.selection.createRange();
+    selection.pasteHTML(start + selection.htmlText + end);
+    iframe.focus();
 }
-Editor.prototype.insert_code = insert_code;
-
-
-/* 
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor.js,v 1.3 2001/12/18 18:21:43 sbeck Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: Event handlers for DHTMLSafe.
- */

+// This is called for tags like [smile] - it replaces any selected text
+function insertTag (tag) {
+    iframe.focus();
+    var selection = editor.selection.createRange();
+    selection.pasteHTML(tag);
+    iframe.focus();
+}

+<%GForum::Markup::get_tags('code', '/code', 'reply', '/reply', 'quote', '/quote')%>

-/***********************************************************/
-/***********************************************************/
-/************ Event handlers for DHTMLSafe      ************/
-/***********************************************************/
-/***********************************************************/
+function insertCode ()  { var sel = editor.selection.createRange(); surroundTag('<%escape_js code%>'  + ((sel.htmlText == '' || sel.htmlText == '\n<P>&nbsp;</P>') ? '<br>' : ''), '<%escape_js /code%>' ); }
+function insertReply () { var sel = editor.selection.createRange(); surroundTag('<%escape_js reply%>' + ((sel.htmlText == '' || sel.htmlText == '\n<P>&nbsp;</P>') ? '<br>' : ''), '<%escape_js /reply%>'); }
+function insertQuote () { var sel = editor.selection.createRange(); surroundTag('<%escape_js quote%>' + ((sel.htmlText == '' || sel.htmlText == '\n<P>&nbsp;</P>') ? '<br>' : ''), '<%escape_js /quote%>'); }

-function DocumentComplete () {
-/* ---------------------------------------------------------
- * Initializes the content of the edit window when the
- * edit window is finished loading the first time.
- */
-       if (this.editor_init) return true;
-       this.editor_init = true;
-       this.debug ("Initializing DHTMLSafe and setting content");
-       if ( this.editor_content ) DHTMLSafe.DocumentHTML = this.editor_content;
+function imageDialog () {
+    var imageSrc = showModalDialog(url + ';do=editor_image', null, "dialogHeight: 135px; dialogWidth: 435px; scroll: no; help: no; status: no");
+    if (imageSrc) {
+        iframe.focus();
+        editor.execCommand('InsertImage', false, imageSrc);
+    }
+    iframe.focus();
 }
-Editor.prototype.DocumentComplete = DocumentComplete;

-function onkeydown () {
-/* ---------------------------------------------------------
- * Function called onKeyPress for the Edit object. Used to 
- * disable certain short cuts during "text mode". Also used 
- * to enable CTRL-D to bring op the Font dialog. 
- */
+function linkDialog () {
+    var sel = editor.selection.createRange();
+    if (sel.htmlText == '' || sel.htmlText == '\n<P>&nbsp;</P>') return;

- // What a strang place to stick an event object
-       var evnt = DHTMLSafe.DOM.parentWindow.event;
-       if (evnt.ctrlKey) {
-
-               switch (evnt.keyCode) {
-                       case 90: // ctrl-z   undo 
-                       case 89: // ctrl-y   redo 
-                       case 67: // ctrl-c   copy 
-                       case 37: // ctrl-left     
-                       case 39: // ctrl-right    
-                               return true;
-            case 68:
-                exec (DECMD_FONT, OLECMDEXECOPT_PROMPTUSER);
-                return this.cancel_event (evnt);
-                       default:
-                               break;
-               }
-       }
-       return true;
+    iframe.focus();
+    setTimeout("editor.execCommand('CreateLink', true); iframe.focus();", 100);
 }
-Editor.prototype.onkeydown = onkeydown;

-function DisplayChanged () {
-/* ---------------------------------------------------------
- * Time critical event handler. Called every time anything
- * changes on the Edit object field. Used to update the 
- * "toggle" menu items and disabled items for "text mode".
- */
-// No debugging in here. This event is ran every second or so.
+function fontDialog () {
+    var sel = editor.selection.createRange();
+    var font = sel.queryCommandValue('FontName');
+    var size = sel.queryCommandValue('FontSize');
+    var color = sel.queryCommandValue('ForeColor');
+    var bold = sel.queryCommandValue('Bold');
+    var italic = sel.queryCommandValue('Italic');
+    var underline = sel.queryCommandValue('Underline');
+    var args = [font, size, color, bold, italic, underline];

- // Loop through all the toolbars
-       var tb_len = this.toolbars.length
-       for (var i = 0; i < tb_len; i++) {
-               if (this.toolbars[i].className == 'toolbar_hidden') continue;
-
-// Get the toolbars children and loop through them.
-               var elements = this.toolbars[i].children;
-               if (!elements) continue;
-               var ele_len = elements.length;
-               for (var e = 0; e < ele_len; e++) {
-                       var current = elements[e];
-                       var image = current.children (0);
-                       if (!current || !image) continue;
-
-                       if (current.enabled) {
-                               var ret = 0;
-                               eval ("ret = " + current.enabled);
-                               if (ret == DECMDF_DISABLED || ret == DECMDF_NOTSUPPORTED) {
-                                       current.style.filter = "alpha(opacity=25)";
-                                       current.state        = 'disabled';
-                                       if (current.id == 'fmt_select') current.disabled = true;
+    // ret is an array, just like args: [font, size, color, b, i, u]
+    var ret = showModalDialog(url + ';do=editor_font', args, "dialogHeight: 332px; dialogWidth: 442px; scroll: no; help: no; status: no");

-                                       // Disabled, no need to toggle check.
-                                       continue;
-                               }
-                               else {
-                                       current.style.filter = "";
-                                       current.state        = 'enabled';
-                                       if (current.id == 'fmt_select') {
-                                               current.disabled = false;
-                                       }
-                               }
-                       }
-                       else {
-                               current.state = 'enabled';
-                               current.style.filter = "";
-                               current.className = "tb_menu_item";
-                               image.className   = "tb_icon";
-                               continue;
+    if (ret) {
+        var applyTo;
+        if (sel.htmlText.length == 0 || sel.htmlText == '\n<P>&nbsp;</P>')
+            applyTo = editor;
+        else
+            applyTo = sel;
+        if (ret[0]) applyTo.execCommand('FontName', false, ret[0]);
+        if (ret[1]) applyTo.execCommand('FontSize', false, ret[1]);
+        if (ret[2]) applyTo.execCommand('ForeColor', false, ret[2]);
+        if (ret[3] != null && ((ret[3] && !bold) || (!ret[3] && bold))) // Toggle bold if bold was on and is now off or if bold was off and is now on
+            applyTo.execCommand('Bold');
+        if (ret[4] != null && ((ret[4] && !italic) || (!ret[4] && italic))) // Toggle italics if it was on and is now off or if it was off and is now on
+            applyTo.execCommand('Italic');
+        if (ret[5] != null && ((ret[5] && !underline) || (!ret[5] && underline))) // Toggle underline if it was on and is now off or if it was off and is now on
+            applyTo.execCommand('Underline');
                        }
+    iframe.focus();
+}

+<%if ie_version >= 6%>
+function colorDialog () {
+    setTimeout('IE6Color(); iframe.focus()');
+}

-// Not a toggle button, make sure the button is in the mouse
-// out position.
-                       if (current.TB_TYPE != 'toggle') continue;
+function IE6Color () {
+    var color = document.all.dlg.ChooseColorDlg();

-// Eval the string
-                       eval("var code = " + current.enabled);
+    var hexColor = color.toString(16);
+    if (hexColor.length < 6) hexColor = "000000".substring(0, 6 - hexColor.length) + hexColor;

-// If we are in that edit mode turn the button on
-                       if (code == DECMDF_LATCHED) {
-                               current.tb_state  = 'on';
-                               current.className = "menu_item_mouseoverdown";
-                               image.className   = "icon_down";
-                       }
-
-// else turn the button off
-                       else {
-                               current.tb_state  = 'off';
-                               current.className = "tb_menu_item";
-                               image.className   = "tb_icon";
-                       }
-               }
-       }
-       return true;
+    editor.execCommand("ForeColor", true, hexColor);
 }
-Editor.prototype.DisplayChanged = DisplayChanged;
+<%else%>
+function colorDialog () {
+    var hexColor = showModalDialog(url + ';do=editor_color', null, "dialogHeight: 380px; dialogWidth: 115px; scroll: no; help: no; status: no");
+    editor.execCommand("ForeColor", true, hexColor);
+    iframe.focus();
+}
+<%endif%>

-/*
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor.js,v 1.3 2001/12/18 18:21:43 sbeck Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: Functions for the editor toolbars.
- */
+/* -- Toolbar initialization is below -- */

-function init_images () {
-/* ---------------------------------------------------------
- * Preloads images and sets the URL for all the images on 
- * the page. If you add other images be sure they are in
- * the directory you set above.
- * This sets the onload event for the images to be displayed.
- */

- // If we are initialized return
-       if (this.images_init) return true;
-       this.debug ("Initializing Images");
-       for (var i = 0; i < document.images.length; i++) {
-               image = document.images[i];
-
-// Images are hidden untill the toolbar is loaded
-               image.style.visibility = 'hidden';
-
-// Do not load images of toolbars that are deleted
-               var pb = image.parentElement.title;
-               var tb = image.parentElement.parentElement.title;
-               if (this.tb_delete[tb] || this.tb_delete[pb]) {
-                       IMAGES_LEN++;
-                       continue;
-               }
-
-// Set the image source
-               var old_src = image.src;
-               image.src = old_src;
-       }
-       this.images_init = true;
-       return true;
-}
-Editor.prototype.init_images = init_images;
+var initInterval, toolbars, tb;

-function init_toolbar () {
+// Keep track of number of images loaded.
+//var imagesLoaded = 0;
+
+function toolbarInit () {
 /* ---------------------------------------------------------
- * Should be called after the document has loaded. 
+ * Should be called after the outerdoc has loaded. 
  * Initializes the Toolbar for display.
  */
-// Toolbar handler
+    // 'toolbars' contains all the div tags
+       var tbs = outerdoc.body.all.tags("DIV");

-       if (this.toolbar_init) return true;
-       this.debug ("Initializing toolbar");
-       var i, s, element;
-       this.tb = {};
-       var tbs = document.body.all.tags ("DIV");
-       var tbs_len = tbs.length;
+    // There are 3 <div>'s. If another is ever added, this number should be incremented.
+    if (tbs.length < 3)
+        return;
+    else
+        clearInterval(tbInterval);

-// Go therough the document and get the toolbar classes
-       for (i=0; i < tbs_len; i++) {
-               element = tbs[i];
+    initialized = true;

-// Store all the toolbar elements
-               this.tb[element.title] = element;
+    tb = {};
+    toolbars = [];
+    document.all.editor_iframe.style.visibility = 'visible';
+// Go through the outerdoc and get the toolbar classes
+       for (var i = 0; i < tbs.length; i++) {
+               var toolbar = tbs[i];

-// The toolbars are hidden till the images are loaded
-               element.TB_INDEX  = this.toolbars.length;
+               tb[toolbar.title] = toolbar;
+               toolbars[toolbars.length] = toolbar;

-// Skip deleted toolbars
-               if (this.tb_delete[element.title]) {
-                       element.className = 'toolbar_hidden';
-                       continue;
-               }
+               toolbar.TB_INDEX  = toolbars.length;

-// Initialize each toolbar
-               if (!this.tb_init (element)) {
-                       this.error ("Could not initialize toolbar:", element.title);
+// Initialize the toolbar
+        tb_init(toolbar);
                }

-// Set progmaticaly hidden toolbars to hidden
-               if (this.tb_hide[element.title]) {
-                       element.className = 'toolbar_hidden';
-               }
-
-// Keep all the toolbars for resizing and hidding
-               this.debug ("Adding toolbar", element.title);
-               this.toolbars[this.toolbars.length] = element;
-       }
-
-       this.tb_layout();
+       tb_layout();

 // If the window is resized we need to re-layout the
 // toolbar.
-       window.onresize = function () { This.tb_layout() };
-       this.toolbar_init = true;
+       toolbar_init = true;
 }
-Editor.prototype.init_toolbar = init_toolbar;
-

-function tb_init_button (element) {
-/* ---------------------------------------------------------
- * Sets op all the defaults for a button DIV. Saves any 
- * onclick and detaches the event. OnClick events are called
- * onMouseDown.
- */
-       if (element.className == "tb_general") return true;
-
-// Set events
-       element.onmouseover   = function () { This.tb_mouseover () }
-       element.onmouseout    = function () { This.tb_mouseout  () }
-       element.onmousedown   = function () { This.tb_mousedown () }
-       element.onmouseup     = function () { This.tb_mouseup   () }
-
-// Disable events
-       element.ondragstart   = function () { This.cancel_event () };
-       element.onselectstart = function () { This.cancel_event () };
-       element.onselect      = function () { This.cancel_event () };
-
-// Save onClick event for onMouseDown
-       element.YUSERONCLICK  = element.onclick;
-       element.onclick       = function () { This.cancel_event () };
-
-// Initial state is enabled
-       element.state = 'enabled';
-
-// If it is a toggle set the initial state.
-       if (element.TB_TYPE == 'toggle') element.tb_state = 'off';
-
-// So we don't re-initialize
-       element.INITIALIZED  = true;
-
-       return true;
-}
-Editor.prototype.tb_init_button = tb_init_button;
-
-function tb_init (element) {
+function tb_init (toolbar) {
 /* ---------------------------------------------------------
  * Called for each toolbar DIV. Populates the toolbar and
  * sets the width.
  */
-       element.TBWidth = 0;
-       if (! this.tb_populate (element)) return false;
-       element.style.posWidth = element.TBWidth;
+       toolbar.TBWidth = 0;
+    tb_populate(toolbar)
+       toolbar.style.posWidth = toolbar.TBWidth;
        return true;
 }
-Editor.prototype.tb_init = tb_init;
-
-function tb_show (menu) {
-/* ---------------------------------------------------------
- * Shows or hiddes a toolbar. The element passed in is the 
- * toolbar object to toggle.
- */
-       var title = menu.title;
-       if (!this.tb[title]) return;
-       if (menu.className == 'toolbar_hidden') {
-               menu.className        = 'toolbar';
-               menu.style.visibility = 'visible';
-       }
-       else {
-               menu.className        = 'toolbar_hidden';
-               menu.style.visibility = 'hidden';
-       }
-       this.tb_layout();
-       return this.cancel_event();
-}
-Editor.prototype.tb_show = tb_show;

-function tb_populate (y) {
+function tb_populate (toolbar) {
 /* ---------------------------------------------------------
- * Moves all a toolbar "y"'s icons to the proper location on
+ * Moves all of toolbar 'toolbar's icons to the proper location on
  * the screen and sets the correct size for the toolbars.
  */
-       var i, elements, element;
-
-       this.debug ("tb_populate called for", y.title);

-       elements = y.children;
+       var elements = toolbar.children;
        if (!elements) return;

 // Loop through all the toolbars children.
-       for (i=0; i < elements.length; i++) {
-               element = elements[i];
+       for (var i = 0; i < elements.length; i++) {
+               var element = elements[i];
                if (element.tagName == "SCRIPT" || element.tagName == "!") continue;

 // Switch to see what element we are workin with.
                switch (element.className) {
-
-// Menu Item then initialize it if it is not initialized.
-                       case "tb_menu_item":
-                               if (element.INITIALIZED == null) {
-                                       if (! this.tb_init_button (element)) return this.error ("Problem initializing:", element.title);
-                               }
-                               element.style.posLeft = y.TBWidth;
-                               y.TBWidth += element.offsetWidth + 1;
+                       case "tb_menu_item": // A button
+                               if (element.INITIALIZED == null)
+                    tb_init_button(element)
+                               element.style.posLeft = toolbar.TBWidth;
+                               toolbar.TBWidth += element.offsetWidth + 1;
                                break;

-// Toolbar element that is not a button
-// most likly a form field.
-                       case "tb_general":
+                       case "tb_general": // Not a button - most likely a form field
+
                        case "tb_menu_text":
-                               element.style.posLeft = y.TBWidth;
-                               y.TBWidth += element.offsetWidth + 5;
+                               element.style.posLeft = toolbar.TBWidth;
+                               toolbar.TBWidth += element.offsetWidth + 5;
                                break;

-// Seperator
-                       case "tb_sep":
-                               element.style.posLeft = y.TBWidth + 2;
-                               y.TBWidth += 5;
+                       case "tb_sep": // Seperator
+                               element.style.posLeft = toolbar.TBWidth + 2;
+                               toolbar.TBWidth += 5;
                                break;

-// Handle for the toolbar, would be cool if people 
-// could move the toolbar. Next version :)
-                       case "tb_handle":
+                       case "tb_handle": // Toolbar handle
                                element.style.posLeft = 2;
-                               y.TBWidth += element.offsetWidth + 7;
+                               toolbar.TBWidth += element.offsetWidth + 7;
                                break;

-// Should never get here unless the html is messed
-                       default:
-                               return this.error ("Invalid class:", element.className,"on Element:", element.id, "<", element.tagName, "> title: <", element.title, ">");
+                       default: // Should never get here unless the html is messed
                }
        }

-// Plus one in case the width is zero
-       y.TBWidth += 1;
-       this.debug ("Toolbar width set to", y.TBWidth);
+       toolbar.TBWidth++; // Add 1 in case the width is zero
+       return true;
+}
+
+function tb_init_button (element) {
+/* ---------------------------------------------------------
+ * Sets op all the defaults for a button DIV. Saves any 
+ * onclick and detaches the event. OnClick events are called
+ * onMouseDown.
+ */
+       if (element.className == "tb_general") return true;
+
+// Set events
+       element.onmouseover   = tb_mouseover;
+       element.onmouseout    = tb_mouseout;
+       element.onmousedown   = tb_mousedown;
+       element.onmouseup     = tb_mouseup;
+
+// Disable events
+       element.ondragstart   = cancel_event;
+       element.onselectstart = cancel_event;
+       element.onselect      = cancel_event;
+
+// Save onClick event for onMouseDown
+       element.YUSERONCLICK  = element.onclick;
+       element.onclick       = cancel_event;
+
+// So we don't re-initialize
+       element.INITIALIZED  = true;
+
        return true;
 }
-Editor.prototype.tb_populate = tb_populate;

 function tb_layout () {
 /* ---------------------------------------------------------
  * Layouts the toolbar on the screen based on the screen
  * width and the widths built in tb_populate().
  */
-       this.debug ("Layout called.");

-       var num_tb = this.toolbars.length;
+    if (!initialized)
+        toolbarInit();
+
+       var num_tb = toolbars.length;

 // No toolbars
-       if (num_tb == 0) { this.debug ("Ack, no toolbars"); return }
+       if (num_tb == 0) return;
        var i;

 // Get the screen width minus the width of the scrollbar
-       var sbar = document.body.offsetWidth - document.body.clientWidth;
-       var ScrWid = (document.body.offsetWidth  - sbar);
-       var ScrHit = (document.body.offsetHeight - sbar);
+       var sbar = outerdoc.body.offsetWidth - outerdoc.body.clientWidth;
+       var ScrWid = (outerdoc.body.offsetWidth  - sbar);
+       var ScrHit = (outerdoc.body.offsetHeight - sbar);

 // Go through the toolbars and find the width of the widest
 // one.
@@ -977,8 +458,7 @@
        var tb = [];
        var e = 0;
        for (i = 0; i < num_tb; i++) {
-               if (this.toolbars[i].className == 'toolbar_hidden') continue;
-               tb[e] = this.toolbars[i];
+               tb[e] = toolbars[i];
                if (tb[e].TBWidth > TotalLen) TotalLen = tb[e].TBWidth;
                e++;
        }
@@ -1022,169 +502,147 @@
                Start    += CurrWid;

        }
-       DHTMLSafe.style.posTop     = (rows * 25);
-       DHTMLSafe.style.posHeight  = ScrHit - (rows * 25) - 5;
-       DHTMLSafe.style.posWidth   = ScrWid - 5;
-       DHTMLSafe.style.visibility = 'visible';
+       outerdoc.all.editor_iframe.style.posTop     = rows * 25;
+       outerdoc.all.editor_iframe.style.posHeight  = ScrHit - (rows * 25);
+       outerdoc.all.editor_iframe.style.posWidth   = ScrWid;
+       outerdoc.all.editor_iframe.style.visibility = 'visible';

 // Set the total width
        TB.style.width = TotalLen - LastStart;

 // Move the rest of the toolbars down
-       i--;
-       TB = tb[i];
+       TB = tb[--i];
        var TBInd = TB.sourceIndex;
        var A = TB.document.all;
        for (var i in A) {
                var item = A.item(i);
-               if (! item)                    continue;
-               if (! item.style)              continue;
-               if (item.sourceIndex <= TBInd) continue;
-               if (! this.tb[item.title])     continue;
-               if (item.className == 'toolbar_hidden')  continue;
+               if (item && item.style && item.sourceIndex > TBInd && tb[item.title])
                item.style.posTop = RelTop;
        }
 }
-Editor.prototype.tb_layout = tb_layout;

 function tb_mouseover () {
 /* ---------------------------------------------------------
  * OnMouseOver event handler function for toolbar buttons.
  */
  // Source must be an image
-       if (event.srcElement.tagName != "IMG")  return this.cancel_event();
+    var event = document.frames.editor_iframe.event;
+       if (event.srcElement.tagName != "IMG") return cancel_event(event);
        var image   = event.srcElement;
        var element = image.parentElement;

 // If we are in text mode and the button is disables for
 // text mode. cancel the mouseover.
-       if (element.state == 'disabled') return this.cancel_event();
+       if (element.disabled) return cancel_event(event);

 // If the image in normal state put it in mouseover state
        if (image.className == "tb_icon") {
                element.className = "menu_item_mouseoverup";
        }
-
 // else if it is in down state put it in mouseover
 // for down states.
        else if (image.className == "icon_down") {
                element.className = "menu_item_mouseoverdown";
        }

-       return this.cancel_event();
+       return cancel_event(event);
 }
-Editor.prototype.tb_mouseover = tb_mouseover;

 function tb_mouseout () {
 /* ---------------------------------------------------------
  * MouseOut event handler function for toolbar buttons
  */
  // The source tag must be an image.
-//     this.debug ("MouseOut event caught for", event.srcElement.title);
-       if (event.srcElement.tagName != "IMG") {
-//             this.debug ("Source is not an image");
-               return this.cancel_event();
-       }
+    var event = document.frames.editor_iframe.event;
+       if (event.srcElement.tagName != "IMG") return cancel_event(event);
        var image   = event.srcElement;
        var element = image.parentElement;

-// IF we are in "text mode" disable mouseout and return
-       if (element.state == 'disabled') {
-//             this.debug ("Source is disabled");
-               return this.cancel_event();
-       }
+       if (element.disabled) return cancel_event(event);

 // If the button is a toggle update it's state.
-       if (element.TB_TYPE == 'toggle' && element.tb_state != 'off') {
+    if (element.isPressed) {
                element.className = "menu_item_mouseoverdown"
                image.className   = 'icon_down';
        }
-
 // else put the image back to it's normal state.
        else {
                element.className  = "tb_menu_item";
                image.className    = "tb_icon";
        }

-       return this.cancel_event();
+    return cancel_event(event);
 }
-Editor.prototype.tb_mouseout = tb_mouseout;

 function tb_mousedown () {
 /* ---------------------------------------------------------
  * MouseDown event handler for toolbar buttons.
  */

-       this.debug ("MouseDown event caught for", event.srcElement.title);
  // The source tag must be an image.
-       if (event.srcElement.tagName != "IMG") { 
-               this.debug ("Source was not an image"); 
-               return this.cancel_event();
-       }
-       var image   = event.srcElement;
+    var evnt = document.frames.editor_iframe.event;
+       if (evnt.srcElement.tagName != "IMG") return cancel_event(evnt);
+       var image   = evnt.srcElement;
        var element = image.parentElement;

 // If we are in "text mode" and the button is not supported in
 // "text mode" cancel the event and return false.
-       if (element.state == 'disabled') { 
-               this.debug (element.title, "disabled"); 
-               return this.cancel_event();
-       }
-
-// If the button is a toggle update it's state.
-
-       if (element.TB_TYPE == 'toggle') {
-               this.debug (element.title, "is toggle. Updating toggle");
-               this.update_toggle (element, image);
-       }
-       else {
+       if (element.disabled) return cancel_event(evnt);

-// Else set the button to the mosedown state.
+    if (element.isPressed != null && !element.isPressed)
+        press(element, image);
                element.className = "menu_item_mouseoverdown";
                image.className   = "icon_down";
-       }

 // We disabled the click function and saved it in this.
 // Eval it here and run it.
-       this.debug ("Calling code", element.YUSERONCLICK);
+
        if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
-       return this.cancel_event();
+       return cancel_event(evnt);
 }
-Editor.prototype.tb_mousedown = tb_mousedown;

 function tb_mouseup () {
 /* ---------------------------------------------------------
  * MouseUp event handler function for toolbar buttons.
  */
  // The source element must be an image type.
-//     this.debug ("Caught mouseup event for", event.srcElement.title);
-       if (event.srcElement.tagName != "IMG") {
-//             this.debug ("Source is not an image");
-               return this.cancel_event();
-       }
+    var event = document.frames.editor_iframe.event;
+       if (event.srcElement.tagName != "IMG") return cancel_event(event);
        var image   = event.srcElement;
        var element = image.parentElement;

 // If we are in "text mode" and the field is disabled in that
 // mode return and cancel the event.
-       if (element.state == 'disabled') {
-//             this.debug ("State is disabled");
-               return this.cancel_event();
-       }
+       if (element.disabled) return cancel_event(event);

 // It the icons to the mouseUp state.
        element.className = "menu_item_mouseoverup";
        image.className   = "tb_icon";

 // Refocus the compose window here.
-       DHTMLSafe.focus();
+       iframe.focus();

-       return this.cancel_event();
+       return cancel_event(event);

 }
-Editor.prototype.tb_mouseup = tb_mouseup;
+
+function cancel_event (evnt) {
+/* ---------------------------------------------------------
+ * General function to cancel an event.
+ */
+    if (!evnt) evnt = event;
+    if (!evnt) return false;
+    evnt.returnValue  = false;
+    evnt.cancelBubble = true;
+    if (event) {
+        event.returnValue  = false;
+        event.cancelBubble = true;
+    }
+    return false;
+}

 /* Help VIM out
 vim:ts=4:shiftwidth=4:syntax=javascript
 */
+

Index: common/editor_about.html
===================================================================
RCS file: common/editor_about.html
diff -N common/editor_about.html
--- common/editor_about.html    16 Dec 2001 21:30:23 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-<html>
-<head><title>About</title>
-<style><%include editor_dialog.css%></style>
-<body>
-<p align=center><font face="Verdana" size="3"><b>IE 5 HTML Editor</b><br>
-Author: Scott Beck<br>&lt;<a href="mailto:sbeck@gossamer-threads.com">sbeck@gossamer-threads.com</a>&gt;</font></p>
-
-<blockquote>
-<p><font face="Verdana" size="2">
-Copyright (c) 2000 Gossamer Threads Inc. Redistribution of the code
-without express written consent is forbidden. To receive the right
-to license this code for use on your site, the original code must be
-copied from gossamer-threads.com. License is granted if and only if
-all copyright notices remain unaltered, and you link from the page on 
-which the code is used to Gossamer Threads at <a href="http://www.gossamer-threads.com/">http://www.gossamer-threads.com/</a>.
-</font></p></blockquote>
-</body>
-</html>
Index: common/editor_color.html
===================================================================
RCS file: common/editor_color.html
diff -N common/editor_color.html
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ common/editor_color.html    10 Jan 2002 08:58:52 -0000      1.1
@@ -0,0 +1,91 @@
+<html>
+<head><title>Select Colour</title>
+  <style>
+    <%include editor_dialog.css%>
+  </style>
+<script language=JScript>
+
+var R, G, B, hexColor;
+
+function setColor() {
+    var x = window.event.offsetX; // 0 - 84
+    var y = window.event.offsetY; // 0 - 199
+
+    var hexColor = getColor(x, y);
+
+    document.all.colortest.style.backgroundColor = hexColor;
+    document.all.OK.style.color = hexColor;
+}
+
+// Returns the hex color clicked on, based on the x and y coordinates.
+function getColor(x, y) {
+    calcRGB(x, y); // After this, R, G, and B contain values from 0 - 1.
+
+    var rgb = 65536 * Math.round(255 * R) + 256 * Math.round(255 * G) + Math.round(255 * B);
+
+    hexColor = rgb.toString(16);
+    if (hexColor.length < 6) hexColor = "000000".substring(0, 6 - hexColor.length) + hexColor;
+
+    return hexColor;
+    //iframe.document.execCommand("ForeColor", false, hexColor);
+}
+
+function calcRGB (x, y) {
+    if (y < 8) {
+        R = G = B = x / 84;
+        return;
+    }
+    y -= 8;
+    var r, g, b;
+    if (y == 0)                  { g = 1; r = b = 0; }
+    else if (y > 0 && y < 32)    { g = 1; b = 0; r = (y - 0) / 32; }
+    else if (y == 32)            { r = g = 1; b = 0; }
+    else if (y > 32 && y < 64)   { r = 1; b = 0; g = (64 - y) / 32; }
+    else if (y == 64)            { r = 1; g = b = 0; }
+    else if (y > 64 && y < 96)   { r = 1; g = 0; b = (y - 64) / 32; }
+    else if (y == 96)            { r = b = 1; g = 0; }
+    else if (y > 96 && y < 128)  { b = 1; g = 0; r = (128 - y) / 32; }
+    else if (y == 128)           { b = 1; r = g = 0; }
+    else if (y > 128 && y < 160) { b = 1; r = 0; g = (y - 128) / 32; }
+    else if (y == 160)           { g = b = 1; r = 0; }
+    else if (y > 160 && y < 192) { g = 1; r = 0; b = (192 - y) / 32; }
+    // r, g, and b are now all ratios from 0 to 1. (ultimately, 0 = 0, 1 = 255)
+    intensity(r, g, b, x / 84);
+}
+
+// Sets R, G, and B to the new values.
+function intensity (r, g, b, i) {
+    if (i == 0) {
+        R = G = B = 0;
+    }
+    else if (i == 1) {
+        R = G = B = 1;
+    }
+    else if (i < 0.5) {
+        i *= 2; // Now 0.0000... - 0.9999...
+        R = r * i;
+        G = g * i;
+        B = b * i;
+    }
+    else if (i > 0.5) {
+        i = (i - 0.5) * 2; // Now 0.0000... - 0.9999...
+        R = r + (1 - r) * i;
+        G = g + (1 - g) * i;
+        B = b + (1 - b) * i;
+    }
+    return;
+}
+
+</script>
+</head>
+<body>
+<center><font size=2>Select colour</font></center>
+<hr>
+<div align=center>
+  <img src="<%image_url%>/colorchart.jpg" width="85" height="200" style="cursor: crosshair" onClick="setColor()"><br><br>
+  <img src="<%image_url%>/clear_shim.gif" width="85" height="20" id="colortest"><br><br>
+  <button class=button id="OK" onclick="window.returnValue = hexColor; window.close()">OK</button><br>
+  <button class=button onclick="window.close();">Cancel</button>
+</div>
+</body>
+</html>
Index: common/editor_constants.js
===================================================================
RCS file: common/editor_constants.js
diff -N common/editor_constants.js
--- common/editor_constants.js  16 Dec 2001 21:30:23 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,97 +0,0 @@
-/* 
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor_constants.js,v 1.1 2001/12/16 21:30:23 jagerman Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: DHTML Editing Component Constants for JavaScript
- * Constants (c) Microsoft Corporation.
- */
-
-//
-// Command IDs
-//
-DECMD_BOLD =                      5000
-DECMD_COPY =                      5002
-DECMD_CUT =                       5003
-DECMD_DELETE =                    5004
-DECMD_DELETECELLS =               5005
-DECMD_DELETECOLS =                5006
-DECMD_DELETEROWS =                5007
-DECMD_FINDTEXT =                  5008
-DECMD_FONT =                      5009
-DECMD_GETBACKCOLOR =              5010
-DECMD_GETBLOCKFMT =               5011
-DECMD_GETBLOCKFMTNAMES =          5012
-DECMD_GETFONTNAME =               5013
-DECMD_GETFONTSIZE =               5014
-DECMD_GETFORECOLOR =              5015
-DECMD_HYPERLINK =                 5016
-DECMD_IMAGE =                     5017
-DECMD_INDENT =                    5018
-DECMD_INSERTCELL =                5019
-DECMD_INSERTCOL =                 5020
-DECMD_INSERTROW =                 5021
-DECMD_INSERTTABLE =               5022
-DECMD_ITALIC =                    5023
-DECMD_JUSTIFYCENTER =             5024
-DECMD_JUSTIFYLEFT =               5025
-DECMD_JUSTIFYRIGHT =              5026
-DECMD_LOCK_ELEMENT =              5027
-DECMD_MAKE_ABSOLUTE =             5028
-DECMD_MERGECELLS =                5029
-DECMD_ORDERLIST =                 5030
-DECMD_OUTDENT =                   5031
-DECMD_PASTE =                     5032
-DECMD_REDO =                      5033
-DECMD_REMOVEFORMAT =              5034
-DECMD_SELECTALL =                 5035
-DECMD_SEND_BACKWARD =             5036
-DECMD_BRING_FORWARD =             5037
-DECMD_SEND_BELOW_TEXT =           5038
-DECMD_BRING_ABOVE_TEXT =          5039
-DECMD_SEND_TO_BACK =              5040
-DECMD_BRING_TO_FRONT =            5041
-DECMD_SETBACKCOLOR =              5042
-DECMD_SETBLOCKFMT =               5043
-DECMD_SETFONTNAME =               5044
-DECMD_SETFONTSIZE =               5045
-DECMD_SETFORECOLOR =              5046
-DECMD_SPLITCELL =                 5047
-DECMD_UNDERLINE =                 5048
-DECMD_UNDO =                      5049
-DECMD_UNLINK =                    5050
-DECMD_UNORDERLIST =               5051
-DECMD_PROPERTIES =                5052
-
-//
-// Enums
-//
-
-// OLECMDEXECOPT  
-OLECMDEXECOPT_DODEFAULT =         0 
-OLECMDEXECOPT_PROMPTUSER =        1
-OLECMDEXECOPT_DONTPROMPTUSER =    2
-
-// DHTMLEDITCMDF
-DECMDF_NOTSUPPORTED =             0 
-DECMDF_DISABLED =                 1 
-DECMDF_ENABLED =                  3
-DECMDF_LATCHED =                  7
-DECMDF_NINCHED =                  11
-
-// DHTMLEDITAPPEARANCE
-DEAPPEARANCE_FLAT =               0
-DEAPPEARANCE_3D =                 1 
-
-// OLE_TRISTATE
-OLE_TRISTATE_UNCHECKED =          0
-OLE_TRISTATE_CHECKED =            1
-OLE_TRISTATE_GRAY =               2
-
Index: common/editor_dialog.css
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/common/editor_dialog.css,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -u -r1.1 -r1.2
--- common/editor_dialog.css    16 Dec 2001 21:30:23 -0000      1.1
+++ common/editor_dialog.css    10 Jan 2002 08:58:52 -0000      1.2
@@ -3,7 +3,7 @@
  *
  *     dialog
  *     Author  : Scott Beck
- *     $Id: editor_dialog.css,v 1.1 2001/12/16 21:30:23 jagerman Exp $
+ *     $Id: editor_dialog.css,v 1.2 2002/01/10 08:58:52 jagerman Exp $
  *
  * Copyright (c) 2000 Gossamer Threads Inc.  All Rights Reserved.
  * ==================================================================
@@ -23,6 +23,16 @@
        font-size        : 8pt;
 }

+.sample {
+        font-family      : "MS Sans Serif";
+        border-left      : buttonshadow solid 1px;
+        border-bottom    : buttonhighlight solid 1px;
+        border-right     : buttonhighlight solid 1px;
+        border-top       : buttonshadow solid 1px;
+        overflow         : hidden;
+        background-color : buttonface;
+}
+
 .button {
        font-family      : "MS Sans Serif";
        background-color : buttonface;
@@ -30,7 +40,7 @@
        width            : 80px;
 }

-.select_list {
+select {
        font-family      : "MS Sans Serif";
        font-size        : 8pt;
        background-color : window;
@@ -38,55 +48,14 @@
        border-left      : buttonshadow solid 2px;
        border-right     : buttonhighlight solid 2px;
        border-top       : buttonshadow solid 2px;
-       width            : 350px;
-       height           : 153px;
        overflow         : hidden;
        cursor           : default;
 }

-.select_list_inner {
+.textbox {
        font-family      : "MS Sans Serif";
        font-size        : 8pt;
        background-color : window;
-       border-bottom    : buttonhighlight solid 2px; 
-       border-left      : buttonshadow solid 2px; 
-       border-right     : buttonhighlight solid 2px; 
-       border-top       : buttonshadow solid 2px;
-       width            : 361px;
-       height           : 153px;
-       overflow         : scroll;
        cursor           : default;
 }

-.select_title {
-       font-family      : "MS Sans Serif";
-       font-size        : 8pt;
-       background-color : buttonface;
-       border-bottom    : buttonshadow solid 1px; 
-       border-top       : buttonhighlight solid 1px;
-       border-left      : buttonhighlight solid 1px; 
-       border-right     : buttonshadow solid 1px; 
-       padding          : 2px;
-       margin           : 0px;
-       cursor           : default;
-}
-
-.select_option {
-       font-family      : "Fixedsys";
-       font-size        : 8px;
-       cursor           : default;
-}
-
-.select_title_outer {
-       font-family      : "MS Sans Serif";
-       font-size        : 8pt;
-       cursor           : default;
-}
-
-.select_option_selected {
-       font-family      : "Fixedsys";
-       font-size        : 8px;
-       background-Color : highlight;
-       color            : white;
-       cursor           : default;
-}
Index: common/editor_edit.js
===================================================================
RCS file: common/editor_edit.js
diff -N common/editor_edit.js
--- common/editor_edit.js       16 Dec 2001 21:30:23 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,121 +0,0 @@
-/*  
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor_edit.js,v 1.1 2001/12/16 21:30:23 jagerman Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: Editing and format functions.
- */
-
-/***********************************************************/
-/***********************************************************/
-/************ HTML Insertion Functions          ************/
-/***********************************************************/
-/***********************************************************/
-
-function insert_html (start, stop) {
-/* ---------------------------------------------------------
- * If called with "start" and "stop" gets the text that
- * is selected in the edit field and pastes "start" on the
- * left of it an "stop" on the right of it. 
- * Like: <textarea> and </textarea>
- * If called is only "start" replaces the selected text with
- * "start".
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-       var selection = DHTMLSafe.DOM.selection.createRange();
-       if (!start) return;
-       if (selection.htmlText == null) {
-               this.debug ("Can't insert html (", start, stop, "). Selection is null");
-               DHTMLSafe.focus();
-               return;
-       }
-       var html = '';
-       if (stop) {
-               this.debug ("Inserting html (", start, stop, ") around (", selection.text, ")");
-               html = start + selection.text + stop;
-       }
-       else {
-               this.debug ("Inserting html (", html, ")");
-               html = start;
-       }
-       if (this.text_mode) html = escape_html (html);
-       selection.pasteHTML (html);
-       DHTMLSafe.focus();
-}
-Editor.prototype.insert_html = insert_html;
-
-function insert_image () {
-/* ---------------------------------------------------------
- * Calles a pop-up diaglog "IMAGE_URL" to prompt the user to
- * select a URL to an image. After that inserts the image 
- * into the document by calling insert_html.
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-       if (DHTMLSafe.DOM.selection.type == 'Control') {
-               this.debug ("Type of selection is Control. Deselection");
-               DHTMLSafe.DOM.selection.empty();
-       }
-       this.debug ("Bringging up dialogue for URL: (", this.image_url, ")");
-    var src = showModalDialog( this.image_url, this, "dialogHeight:170px;dialogWidth:435px" );
-    if ( src ) this.insert_html( '<img src="' + src + '">' );
-}
-Editor.prototype.insert_image = insert_image;
-
-function insert_hr () {
-/* ---------------------------------------------------------
- * Inserts the html needed for an hr
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('hr')%>
-    this.insert_html( '<%escape_js hr%><br>' )
-}
-Editor.prototype.insert_hr = insert_hr;
-
-function insert_quote () {
-/* ---------------------------------------------------------
- * Inserts the html needed for a quote
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('quote', '/quote')%>
-    var start = '<%escape_js quote%><br>';
-    var end   = '<%escape_js /quote%>';
-    this.insert_html( start, end );
-}
-Editor.prototype.insert_quote = insert_quote;
-
-function insert_reply () {
-/* ---------------------------------------------------------
- * Inserts the html needed for a reply
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('reply', '/reply')%>
-    var start = '<%escape_js reply%><br>';
-    var end   = '<%escape_js /reply%>';
-    this.insert_html( start, end );
-}
-Editor.prototype.insert_reply = insert_reply;
-
-function insert_code () {
-/* ---------------------------------------------------------
- * Inserts the html needed for a code
- */
-       if (DHTMLSafe.Busy) return this.cancel_event();
-    <%GForum::Markup::get_tags('code', '/code')%>
-    var start = '<%escape_js code%><br>';
-    var end   = '<%escape_js /code%>';
-    this.insert_html( start, end );
-}
-Editor.prototype.insert_code = insert_code;
-
-
-/* Help VIM out
-vim:ts=4:shiftwidth=4:syntax=javascript
-*/
-
Index: common/editor_editor.html
===================================================================
RCS file: common/editor_editor.html
diff -N common/editor_editor.html
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ common/editor_editor.html   11 Jan 2002 23:18:19 -0000      1.1
@@ -0,0 +1,23 @@
+<%--
+
+editor_editor.html
+
+This file is used as the actual part where you write the
+post or message. This file should contain ONLY up and
+including the <body> tag of the page. The </body></html>
+will be added automatically. Take care when changing the
+body tag - it must have contenteditable="true" and id="post"
+or you will BREAK THE ADVANCED EDITOR.
+
+--%>
+<html>
+<head>
+<style>
+body {
+    background-color      : <%advanced_editor_background%>;
+    font-family           : "<%advanced_editor_font%>";
+}
+</style>
+<%include include_css.html%>
+</head>
+<body contenteditable="true" id="post">
Index: common/editor_events.js
===================================================================
RCS file: common/editor_events.js
diff -N common/editor_events.js
--- common/editor_events.js     16 Dec 2001 21:30:23 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,143 +0,0 @@
-/* 
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor_events.js,v 1.1 2001/12/16 21:30:23 jagerman Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: Event handlers for DHTMLSafe.
- */
-
-
-
-/***********************************************************/
-/***********************************************************/
-/************ Event handlers for DHTMLSafe      ************/
-/***********************************************************/
-/***********************************************************/
-
-function DocumentComplete () {
-/* ---------------------------------------------------------
- * Initializes the content of the edit window when the
- * edit window is finished loading the first time.
- */
-       if (this.editor_init) return true;
-       this.editor_init = true;
-       this.debug ("Initializing DHTMLSafe and setting content");
-       if ( this.editor_content ) DHTMLSafe.DocumentHTML = this.editor_content;
-}
-Editor.prototype.DocumentComplete = DocumentComplete;
-
-function onkeydown () {
-/* ---------------------------------------------------------
- * Function called onKeyPress for the Edit object. Used to 
- * disable certain short cuts during "text mode". Also used 
- * to enable CTRL-D to bring op the Font dialog. 
- */
-
- // What a strang place to stick an event object
-       var evnt = DHTMLSafe.DOM.parentWindow.event;
-       if (evnt.ctrlKey) {
-
-               switch (evnt.keyCode) {
-                       case 90: // ctrl-z   undo 
-                       case 89: // ctrl-y   redo 
-                       case 67: // ctrl-c   copy 
-                       case 37: // ctrl-left     
-                       case 39: // ctrl-right    
-                               return true;
-            case 68:
-                exec (DECMD_FONT, OLECMDEXECOPT_PROMPTUSER);
-                return this.cancel_event (evnt);
-                       default:
-                               break;
-               }
-       }
-       return true;
-}
-Editor.prototype.onkeydown = onkeydown;
-
-function DisplayChanged () {
-/* ---------------------------------------------------------
- * Time critical event handler. Called every time anything
- * changes on the Edit object field. Used to update the 
- * "toggle" menu items and disabled items for "text mode".
- */
-// No debugging in here. This event is ran every second or so.
-
- // Loop through all the toolbars
-       var tb_len = this.toolbars.length
-       for (var i = 0; i < tb_len; i++) {
-               if (this.toolbars[i].className == 'toolbar_hidden') continue;
-
-// Get the toolbars children and loop through them.
-               var elements = this.toolbars[i].children;
-               if (!elements) continue;
-               var ele_len = elements.length;
-               for (var e = 0; e < ele_len; e++) {
-                       var current = elements[e];
-                       var image = current.children (0);
-                       if (!current || !image) continue;
-
-                       if (current.enabled) {
-                               var ret = 0;
-                               eval ("ret = " + current.enabled);
-                               if (ret == DECMDF_DISABLED || ret == DECMDF_NOTSUPPORTED) {
-                                       current.style.filter = "alpha(opacity=25)";
-                                       current.state        = 'disabled';
-                                       if (current.id == 'fmt_select') current.disabled = true;
-
-                                       // Disabled, no need to toggle check.
-                                       continue;
-                               }
-                               else {
-                                       current.style.filter = "";
-                                       current.state        = 'enabled';
-                                       if (current.id == 'fmt_select') {
-                                               current.disabled = false;
-                                       }
-                               }
-                       }
-                       else {
-                               current.state = 'enabled';
-                               current.style.filter = "";
-                               current.className = "tb_menu_item";
-                               image.className   = "tb_icon";
-                               continue;
-                       }
-
-
-// Not a toggle button, make sure the button is in the mouse
-// out position.
-                       if (current.TB_TYPE != 'toggle') continue;
-
-// Eval the string
-                       eval("var code = " + current.enabled);
-
-// If we are in that edit mode turn the button on
-                       if (code == DECMDF_LATCHED) {
-                               current.tb_state  = 'on';
-                               current.className = "menu_item_mouseoverdown";
-                               image.className   = "icon_down";
-                       }
-
-// else turn the button off
-                       else {
-                               current.tb_state  = 'off';
-                               current.className = "tb_menu_item";
-                               image.className   = "tb_icon";
-                       }
-               }
-       }
-       return true;
-}
-Editor.prototype.DisplayChanged = DisplayChanged;
-
-/* Help VIM out
-vim:ts=4:shiftwidth=4:syntax=javascript
-*/
Index: common/editor_font.html
===================================================================
RCS file: common/editor_font.html
diff -N common/editor_font.html
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ common/editor_font.html     11 Jan 2002 23:18:19 -0000      1.3
@@ -0,0 +1,234 @@
+<html>
+<head><title>Select Font</title>
+<style>
+<%include editor_dialog.css%>
+</style>
+<script language=JScript>
+<!--
+returnValue = [];
+
+var font, size, color, b, i, u, input;
+
+function initDialog () {
+
+    input = window.dialogArguments;
+    // input is: [font, size, color, b, i, u]
+
+    populateFont();
+
+    if (input[1]) { // Size
+        sizeList.selectedIndex = input[1] - 1;
+        sizeList.fireEvent("onchange");
+    }
+
+    if (input[2]) { // Color. This is actually something very strange - instead of RGB, it's BGR ???
+        var hexColor = input[2].toString(16);
+        if (hexColor.length < 6) hexColor = "000000".substring(0, 6 - hexColor.length) + hexColor;
+        hexColor = hexColor.substring(4, 6) + hexColor.substring(2, 4) + hexColor.substring(0, 2);
+        colorList.selectedIndex = 16;
+        setColor(hexColor);
+    }
+
+    if (input[3] != null || input[4] != null) {
+        if (input[3] && input[4])
+            styleList.selectedIndex = 3;
+        else if (input[3])
+            styleList.selectedIndex = 1;
+        else if (input[4])
+            styleList.selectedIndex = 2;
+        else
+            styleList.selectedIndex = 0;
+
+        styleList.fireEvent("onchange");
+    }
+
+    if (input[5] != null && underlineBox.checked != input[5]) {
+        underlineBox.click();
+    }
+
+}
+
+function addFont (select, fontName) {
+    var option = document.createElement("OPTION");
+    select.options.add(option);
+    option.innerText = fontName;
+    option.value = fontName;
+    if (input[0] && input[0] == fontName) {
+        select.selectedIndex = select.options.length - 1;
+        select.fireEvent("onchange");
+    }
+}
+
+function populateFont() {
+<%if ie_version >= 6%>
+    var fonts = [];
+    for (var i = 1; i <= dlg.fonts.count; i++) fonts[i - 1] = dlg.fonts(i);
+    fonts.sort();
+    for (var i = 0; i < fonts.length; i++) addFont(fontList, fonts[i]);
+<%else%>
+    addFont(fontList, 'Arial');
+    addFont(fontList, 'Arial Black');
+    addFont(fontList, 'Arial Narrow');
+    addFont(fontList, 'Century Gothic');
+    addFont(fontList, 'Comic Sans MS');
+    addFont(fontList, 'Courier');
+    addFont(fontList, 'Courier New');
+    addFont(fontList, 'Fixedsys');
+    addFont(fontList, 'Garamond');
+    addFont(fontList, 'Georgia');
+    addFont(fontList, 'Lucida Console');
+    addFont(fontList, 'MS Sans Serif');
+    addFont(fontList, 'MS Serif');
+    addFont(fontList, 'System');
+    addFont(fontList, 'Tahoma');
+    addFont(fontList, 'Times New Roman');
+    addFont(fontList, 'Verdana');
+    addFont(fontList, 'Webdings');
+    addFont(fontList, 'Wingdings');
+    addFont(fontList, 'Wingdings 2');
+    addFont(fontList, 'Wingdings 3');
+<%endif%>
+}
+
+function setFont() {
+    font = event.srcElement.value;
+    fontBox.innerText = font;
+    sample.style.fontFamily = font;
+}
+
+var cssSizeConv = [null, '8pt', '10pt', '12pt', '14pt', '18pt', '24pt', '36pt'];
+
+function setSize() {
+    var opt = sizeList.options[sizeList.selectedIndex];
+    size = opt.value; // 1 - 7, use on cssSizeConv
+    sample.style.fontSize = cssSizeConv[size];
+    sizeBox.innerText = opt.innerText;
+}
+
+function setStyle() {
+    var opt = styleList.options[styleList.selectedIndex];
+    styleBox.innerText = opt.innerText;
+    if (opt.value == 'r') {
+        b = false;
+        i = false;
+        sample.style.fontWeight = "normal";
+        sample.style.fontStyle = "normal";
+    }
+    else if (opt.value == 'b') {
+        b = true;
+        i = false;
+        sample.style.fontWeight = "bold";
+        sample.style.fontStyle = "normal";
+    }
+    else if (opt.value == 'i') {
+        b = false;
+        i = true;
+        sample.style.fontWeight = "normal";
+        sample.style.fontStyle = "italic";
+    }
+    else if (opt.value == 'bi') {
+        b = true;
+        i = true;
+        sample.style.fontWeight = "bold";
+        sample.style.fontStyle = "italic";
+    }
+}
+
+function setUnderline(val) { // val should be true or false
+    u = val;
+    sample.style.textDecorationUnderline = val;
+}
+
+function setReturn () {
+    returnValue = [font, size, color, b, i, u];
+}
+
+function setColor (clr) {
+    if (clr) {
+        color = clr;
+        sample.style.color = clr;
+    }
+    else {
+        color = null;
+        sample.style.color = 'black';
+    }
+}
+
+// Bug? The '/' on the following line shouldn't be needed (and isn't needed from the main page). Why is it needed here???
+var url = window.location.protocol + '//' + window.location.hostname + '/' + window.location.pathname + '?<%hidden_query%>';
+function colorDialog () {
+<%if ie_version >= 6%>
+    var hexColor = dlg.ChooseColorDlg().toString(16);
+    if (hexColor.length < 6) hexColor = "000000".substring(0, 6 - hexColor.length) + hexColor;
+<%else%>
+    var hexColor = showModalDialog(url + ';do=editor_color', null, "dialogHeight: 380px; dialogWidth: 115px; scroll: no; help: no; status: no");
+<%endif%>
+
+    setColor(hexColor);
+}
+
+-->
+</script>
+</head>
+<body onLoad="initDialog()">
+<%if ie_version >= 6%><object id="dlg" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object><%endif%>
+  
+  <div style="position: absolute; top: 7px; left: 10px">Font:</div>
+  <input type="text" class="textbox" id="fontBox" style="font-size: 8pt; font-family: MS Sans Serif; height: 22px; width: 160px; position: absolute; top: 27px; left: 10px">
+  <select id="fontList" size="7" style="width: 162px; position: absolute; top: 49px; left: 9px" onchange="setFont()"></select>
+
+  <div style="border-style: groove; border-width: 2px; position: absolute; top: 190px; left: 10px; height: 100px; width: 160px"><div style="position: relative; top: -9px; left: 5px; width: 0px; background-color: buttonface">&nbsp;Effects&nbsp;</div></div>
+  <input type="checkbox" id="underlineBox" style="position: absolute; top: 207px; left: 25px" onclick="setUnderline(this.checked)">
+  <div type="text" style="font-family: 'MS Sans Serif'; font-size: 8pt; border-width: 0px; position: absolute; top: 209px; left: 48px; width: 60px" onclick="underlineBox.click()">Underline</div>
+
+  <div style="position: absolute; top: 233px; left: 25px">Color:</div>
+  <select id="colorList" size="1" style="font-face: 8pt; width: 80; position: absolute; top: 253px; left: 25px" onchange="setColor(this.value)">
+    <option value="black">Black</option>
+    <option value="gray">Gray</option>
+    <option value="silver">Silver</option>
+    <option value="white">White</option>
+    <option value="lime">Lime</option>
+    <option value="green">Green</option>
+    <option value="yellow">Yellow</option>
+    <option value="olive">Olive</option>
+    <option value="red">Red</option>
+    <option value="maroon">Maroon</option>
+    <option value="fuchsia">Fuchsia</option>
+    <option value="purple">Purple</option>
+    <option value="aqua">Aqua</option>
+    <option value="teal">Teal</option>
+    <option value="navy">Navy</option>
+    <option value="blue">Blue</option>
+    <option value="">Custom</option>
+  </select>
+  <button style="position: absolute; top: 250px; left: 115px; font-family: 'MS Sans Serif'; font-size: 8pt; height: 25px; width: 25px" onclick="colorList.selectedIndex = colorList.options.length - 1; colorDialog()"><img src="<%image_url%>/toolbar/font_color.gif" width="23" height="23"></button>
+  
+  <div style="position: absolute; top: 7px; left: 180px">Style:</div>
+  <input type="text" class="textbox" id="styleBox" style="font-size: 8pt; height: 22px; width: 77px; position: absolute; top: 27px; left: 185px" readonly>
+  <select id="styleList" size="7" style="width: 79px; position: absolute; top: 49px; left: 184px" onchange="setStyle()">
+    <option value="r">Regular</option>
+    <option value="b">Bold</option>
+    <option value="i">Italic</option>
+    <option value="bi">Bold Italic</option>
+  </select>
+  
+  <div style="position: absolute; top: 7px; left: 277px">Size:</div>
+  <input type="text" class="textbox" id="sizeBox" style="font-size: 8pt; height: 22px; width: 60px; position: absolute; top: 27px; left: 277px" readonly>
+  <select id="sizeList" size="7" style="width: 62px; position: absolute; top: 49px; left: 276px" onchange="setSize()">
+    <option value="1">8</option>
+    <option value="2">10</option>
+    <option value="3">12</option>
+    <option value="4">14</option>
+    <option value="5">18</option>
+    <option value="6">24</option>
+    <option value="7">36</option>
+  </select>
+
+  <div style="border-style: groove; border-width: 2px; position: absolute; top: 190px; left: 185px; height: 100px; width: 153px"><div style="position: relative; top: -9px; left: 5px; width: 0px; background-color: buttonface">&nbsp;Sample&nbsp;</div></div>
+  <table width="131" height="70" style="position: absolute; top: 207px; left: 195px" cellpadding=0 cellspacing=0><tr><td valign="middle" align="center" id="sample" class="sample"><span style="overflow: hidden; width: 131px">AaBbYyZz</span></td></tr></table>
+
+  <button class="button" onclick="setReturn(); window.close()" style="position: absolute; top: 26px; left: 345px">OK</button>
+  <button class="button" onclick="window.close()" style="position: absolute; top: 54px; left: 345px">Cancel</button>
+
+</body>
+</html>
Index: common/editor_iframe.html
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/common/editor_iframe.html,v
retrieving revision 1.7
retrieving revision 1.10
diff -b -u -r1.7 -r1.10
--- common/editor_iframe.html   18 Dec 2001 21:42:59 -0000      1.7
+++ common/editor_iframe.html   11 Jan 2002 23:18:19 -0000      1.10
@@ -1,150 +1,104 @@
 <html>
-<head><title>HTML Editor</title>
+<head>

-<!-- Public editor interface -->
-<script language="JScript" src="gforum.cgi?do=editor_js"></script>
+<%include include_css.html%>

-<!-- Style sheet for toolbar -->
-<link rel="stylesheet" type="text/css" href="gforum.cgi?do=editor_css">
+<style type="text/css" media="screen">
+<!--
+<%include editor_style.css%>
+-->
+</style>

 </head>
-<body bgcolor="<%editor_base_color%>" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" rightmargin="0" onLoad="parent.load_html()">

-<div class="toolbar" id="File" title="File" onselectstart="return This.cancel_event ();">
+<body leftmargin="0" topmargin="0" bgcolor="<%editor_base_color%>">
+
+<div class="toolbar" id="File" title="File" onselectstart="return parent.cancel_event();">
        <!--====================================-->
        <span title="Handle" class=tb_handle></span>
-       <span title="Cut Div" enabled="This.query (DECMD_CUT);" TB_TYPE="button" onclick="This.exec(DECMD_CUT);" class="tb_menu_item">
-               <img title="Cut" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/cut.gif" alt="Bold"></img>
-       </span>
-       <span title="Copy Div" enabled="This.query (DECMD_COPY);" TB_TYPE="button" onclick="This.exec(DECMD_COPY);" class="tb_menu_item">
-               <img title="Copy" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/copy.gif" alt="Copy"></img>
+  <span id="cut" title="Cut Div" onclick="parent.command('Cut')" class="tb_menu_item">
+    <img title="Cut" class="tb_icon" src="<%image_url%>/toolbar/cut.gif" alt="Bold">
        </span>
-       <span title="Paste Div" enabled="This.query (DECMD_PASTE);" TB_TYPE="button" onclick="This.exec(DECMD_PASTE);" class="tb_menu_item">
-               <img title="Paste" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/paste.gif" alt="Paste"></img>
+  <span id="copy" title="Copy Div" onclick="parent.command('Copy')" class="tb_menu_item">
+    <img title="Copy" class="tb_icon" src="<%image_url%>/toolbar/copy.gif" alt="Copy">
        </span>
-       <!----------------------------------------->
-       <span title="Seperator" class="tb_sep"></span>
-       <span title="Undo Div" enabled="This.query (DECMD_UNDO);" TB_TYPE="button" onclick="This.exec(DECMD_UNDO)" class="tb_menu_item">
-               <img title="Undo" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/undo.gif" alt="Undo"></img>
-       </span>
-       <span title="Redo Div" enabled="This.query (DECMD_REDO);" TB_TYPE="button" onclick="This.exec(DECMD_REDO)" class="tb_menu_item">
-               <img title="Redo" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/redo.gif" alt="Redo"></img>
-       </span>
-       <span title="Seperator" class="tb_sep"></span>
-       <span title="Find Div" enabled="This.query (DECMD_FINDTEXT);" TB_TYPE="button" onclick="This.exec(DECMD_FINDTEXT, OLECMDEXECOPT_DODEFAULT, '', 1)" class="tb_menu_item">
-               <img title="Find" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/find.gif" alt="Find"></img>
+  <span id="paste" title="Paste Div" onclick="parent.command('Paste')" class="tb_menu_item">
+    <img title="Paste" class="tb_icon" src="<%image_url%>/toolbar/paste.gif" alt="Paste">
        </span>
 </div>

-<div class="toolbar" id="Format" title="Format" onselectstart="return This.cancel_event ();">
+<div class="toolbar" id="Format" title="Format" onselectstart="return parent.cancel_event ();">
        <!--=====================================-->
        <span title="Handle" class=tb_handle></span>
-       <span title="Bold Item" enabled="This.query (DECMD_BOLD);" TB_TYPE="toggle" onclick="This.exec(DECMD_BOLD);" class="tb_menu_item">
-               <img title="Bold" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/bold.gif" alt="Bold"></img>
+       <span id="bold" title="Bold Item" onclick="parent.command('Bold');" class="tb_menu_item">
+               <img id="boldImage" title="Bold" class="tb_icon" src="<%image_url%>/toolbar/bold.gif" alt="Bold"></img>
        </span>
-       <span title="Italic Item" enabled="This.query (DECMD_ITALIC);" TB_TYPE="toggle" onclick="This.exec(DECMD_ITALIC)" class="tb_menu_item">
-               <img title="Italic" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/italic.gif" alt="Italic"></img>
+       <span id="italic" title="Italic Item" onclick="parent.command('Italic');" class="tb_menu_item">
+               <img id="italicImage" title="Italic" class="tb_icon" src="<%image_url%>/toolbar/italic.gif" alt="Italic"></img>
        </span>
-       <span title="Underline Item" enabled="This.query (DECMD_UNDERLINE);" TB_TYPE="toggle" onclick="This.exec(DECMD_UNDERLINE)" class="tb_menu_item">
-               <img title="Underline" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/under.gif" alt="Underline"></img>
+       <span id="underline" title="Underline Item" onclick="parent.command('Underline');" class="tb_menu_item">
+               <img id="underlineImage" title="Underline" class="tb_icon" src="<%image_url%>/toolbar/under.gif" alt="Underline"></img>
        </span>
        <!----------------------------------------->
        <span title="Seperator" class="tb_sep"></span>
-  <span title="Quote" TB_TYPE="button" onclick="This.insert_quote()" class="tb_menu_item">
-    <img title="Quote" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/quote.gif" alt="Quote"></img>
+        <span title="Quote" onclick="parent.insertQuote()" class="tb_menu_item">
+                <img title="Quote" class="tb_icon" src="<%image_url%>/toolbar/quote.gif" alt="Quote"></img>
        </span>
-  <span title="Reply" TB_TYPE="button" onclick="This.insert_reply()" class="tb_menu_item">
-    <img title="Reply" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/reply.gif" alt="Reply"></img>
+        <span title="Reply" onclick="parent.insertReply()" class="tb_menu_item">
+                <img title="Reply" class="tb_icon" src="<%image_url%>/toolbar/reply.gif" alt="Reply"></img>
        </span>
-  <span title="Code" TB_TYPE="button" onclick="This.insert_code()" class="tb_menu_item">
-    <img title="Code" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/code.gif" alt="Code"></img>
+        <span title="Code" onclick="parent.insertCode()" class="tb_menu_item">
+               <img title="Code" class="tb_icon" src="<%image_url%>/toolbar/code.gif" alt="Code"></img>
        </span>
        <!----------------------------------------->
        <span title="Seperator" class="tb_sep"></span>
-       <span title="Left Div" enabled="This.query (DECMD_JUSTIFYLEFT);" TEXT_MODE='no' TB_TYPE="toggle" onclick="This.exec(DECMD_JUSTIFYLEFT)" class="tb_menu_item">
-               <img title="Left" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/left.gif" alt="Justify Left"></img>
+       <span id="jleft" title="Left Div" TEXT_MODE='no' onclick="parent.command('JustifyLeft');" class="tb_menu_item">
+               <img id="jleftImage" title="Justify Left" class="tb_icon" src="<%image_url%>/toolbar/left.gif" alt="Justify Left"></img>
        </span>
-       <span title="Center Div" enabled="This.query (DECMD_JUSTIFYCENTER);" TEXT_MODE='no' TB_TYPE="toggle" onclick="This.exec(DECMD_JUSTIFYCENTER)" class="tb_menu_item">
-               <img title="Center" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/center.gif" alt="Justify Center"></img>
+       <span id="jcenter" title="Center Div" TEXT_MODE='no' onclick="parent.command('JustifyCenter');" class="tb_menu_item">
+               <img id="jcenterImage" title="Justify Center" class="tb_icon" src="<%image_url%>/toolbar/center.gif" alt="Justify Center"></img>
        </span>
-       <span title="Right Div" enabled="This.query (DECMD_JUSTIFYRIGHT);" TEXT_MODE='no' TB_TYPE="toggle" onclick="This.exec(DECMD_JUSTIFYRIGHT)" class="tb_menu_item">
-               <img title="Rigth" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/right.gif" alt="Justify Right"></img>
+       <span id="jright" title="Right Div" TEXT_MODE='no' onclick="parent.command('JustifyRight');" class="tb_menu_item">
+               <img id="jrightImage" title="Justify Right" class="tb_icon" src="<%image_url%>/toolbar/right.gif" alt="Justify Right"></img>
        </span>
        <!----------------------------------------->
        <span title="Seperator" class="tb_sep"></span>
-       <span title="OL Div" enabled="This.query (DECMD_ORDERLIST);" TEXT_MODE='no' TB_TYPE="toggle" onclick="This.exec(DECMD_ORDERLIST)" class="tb_menu_item">
-               <img title="OL" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/numlist.gif" alt="Ordered List"></img>
+       <span id="ol" title="OL Div" TEXT_MODE='no' onclick="parent.command('InsertOrderedList');" class="tb_menu_item">
+               <img id="olImage" title="Ordered List" class="tb_icon" src="<%image_url%>/toolbar/numlist.gif" alt="Ordered List"></img>
        </span>
-       <span title="UL Div" enabled="This.query (DECMD_UNORDERLIST);" TEXT_MODE='no' TB_TYPE="toggle" onclick="This.exec(DECMD_UNORDERLIST)" class="tb_menu_item">
-               <img title="UL" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/bullist.gif" alt="Un-Ordered List"></img>
+       <span id="ul" title="UL Div" TEXT_MODE='no' onclick="parent.command('InsertUnorderedList');" class="tb_menu_item">
+               <img id="ulImage" title="Unordered List" class="tb_icon" src="<%image_url%>/toolbar/bullist.gif" alt="Unordered List"></img>
        </span>
-       <span title="Outdent Div" enabled="This.query (DECMD_OUTDENT);" TB_TYPE="button" onclick="This.exec(DECMD_OUTDENT)" TEXT_MODE='no' class="tb_menu_item">
-               <img title="Outdent" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/deindent.gif" alt="Outdent"></img>
+       <span title="Outdent Div" onclick="parent.command('Outdent')" TEXT_MODE='no' class="tb_menu_item">
+               <img title="Outdent" class="tb_icon" src="<%image_url%>/toolbar/outdent.gif" alt="Outdent"></img>
        </span>
-       <span title="Indent Div" enabled="This.query (DECMD_INDENT);" TB_TYPE="button" onclick="This.exec(DECMD_INDENT)" TEXT_MODE='no' class="tb_menu_item">
-               <img title="Indent" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/inindent.gif" alt="Indent"></img>
+       <span title="Indent Div" onclick="parent.command('Indent')" TEXT_MODE='no' class="tb_menu_item">
+               <img title="Indent" class="tb_icon" src="<%image_url%>/toolbar/indent.gif" alt="Indent"></img>
        </span>
        <!----------------------------------------->
        <span title="Sperator" class="tb_sep"></span>
-       <span title="Font Div" enabled="This.query (DECMD_FONT);" TEXT_MODE='no' TB_TYPE="button" onclick="This.exec (DECMD_FONT, OLECMDEXECOPT_PROMPTUSER)" class="tb_menu_item">
-               <img title="Font" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/font.gif" alt="Font"></img>
+       <span title="Font Div" TEXT_MODE='no' onclick="parent.fontDialog()" class="tb_menu_item">
+               <img title="Font Face" class="tb_icon" src="<%image_url%>/toolbar/font.gif" alt="Font Face"></img>
+       </span>
+       <span title="Font Div" TEXT_MODE='no' onclick="parent.colorDialog()" class="tb_menu_item">
+               <img title="Font Color" class="tb_icon" src="<%image_url%>/toolbar/font_color.gif" alt="Font Color"></img>
        </span>
 </div>
-<div class="toolbar" id="Misc" title="Misc" onselectstart="return This.cancel_event ();">
+<div class="toolbar" id="Misc" title="Misc" onselectstart="return parent.cancel_event();">
        <!--=====================================-->
        <span title="Handle" class=tb_handle></span>
-       <span title="Horizontal Rule Div" TB_TYPE="button" onclick="This.insert_hr();" class="tb_menu_item">
-               <img title="Horizontal Rule" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/hr.gif" alt="Horizontal Rule"></img>
+       <span title="Horizontal Rule Div" onclick="parent.command('InsertHorizontalRule')" class="tb_menu_item">
+               <img title="Horizontal Rule" class="tb_icon" src="<%image_url%>/toolbar/hr.gif" alt="Horizontal Rule"></img>
        </span>
        <!----------------------------------------->
        <span title="Seperator" class="tb_sep"></span>
-       <span title="Image Div" TB_TYPE="button" onclick="This.insert_image()" class="tb_menu_item">
-               <img title="Image" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/image.gif" alt="Insert Image"></img>
+       <span title="Image Div" onclick="parent.imageDialog()" class="tb_menu_item">
+               <img title="Image" class="tb_icon" src="<%image_url%>/toolbar/image.gif" alt="Insert Image"></img>
        </span>
-       <span title="Link Div" enabled="This.query (DECMD_HYPERLINK);" TB_TYPE="button" onclick="This.exec(DECMD_HYPERLINK, OLECMDEXECOPT_PROMPTUSER)" class="tb_menu_item">
-               <img title="Link" onload="IMAGES_LEN++;" class="tb_icon" src="<%image_url%>/toolbar/link.gif" alt="Create Link"></img>
+       <span id="link" title="Link Div" onclick="parent.linkDialog()" class="tb_menu_item">
+               <img id="linkImage" title="Link" class="tb_icon" src="<%image_url%>/toolbar/link.gif" alt="Create Link"></img>
        </span>
 </div>
-
-<!-- The DHTML Edit object. -->
-<object id="DHTMLSafe" title="Main Edit Window" style="position:absolute" classid="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A" tabindex="6">
-       <param name="ShowDetails" value="0">
-       <param name="ShowBorders" value="0">
-       <param name="Appearance" value="1">
-       <param name="Scrollbars" value="-1">
-       <param name="ScrollbarAppearance" value="1">
-       <param name="AbsoluteDropMode" value="-1">
-       <param name="SourceCodePreservation" value="0">
-       <param name="UseDivOnCarriageReturn" value="0">
-       <param name="ActivateDTCs" value="0">
-       <param name="BrowseMode" value="1">
-</object>
-<%-- Event handlers for DHTMLSafe --%>
-
-<script for="DHTMLSafe" event="DocumentComplete">
-<!--
-// Editor Object loaded
-    if (!This) return false;
-    return This.DocumentComplete ();
-// -->
-</script>
-
-<script for=DHTMLSafe event=DisplayChanged>
-<!--
-// Editor Object changed
-    if (!This) return false;
-    return This.DisplayChanged ();
-// -->
-</script>
-
-<script for=DHTMLSafe event=onkeydown>
-<!--
-// Key press event for short cut keys
-    if (!This) return false;
-    return This.onkeydown ();
-// -->
-</script>
-
+<iframe width="100%" height="200" name="editor_iframe" id="editor_iframe" style="position: absolute"></iframe>
 </body>
 </html>
-
Index: common/editor_style.css
===================================================================
RCS file: /usr/local/gossamer/gforum/cgi/admin/templates/common/editor_style.css,v
retrieving revision 1.1
retrieving revision 1.3
diff -b -u -r1.1 -r1.3
--- common/editor_style.css     16 Dec 2001 21:30:23 -0000      1.1
+++ common/editor_style.css     11 Jan 2002 23:18:19 -0000      1.3
@@ -1,9 +1,9 @@
 /*
  * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
+ * HTML Editor - A wysiwyg web based editor for IE5.5+
  *    Website  : http://gossamer-threads.com/
  *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor_style.css,v 1.1 2001/12/16 21:30:23 jagerman Exp $
+ *    Revision : $Id: editor_style.css,v 1.3 2002/01/11 23:18:19 jagerman Exp $
  *
  * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
  * Redistribution in part or in whole strictly prohibited. Please
@@ -18,23 +18,12 @@
         scrollbar-arrow-color: #00ff33;
 }

-.compose {
-       position      : absolute;
-       border-bottom : buttonface solid 1px;
-       border-left   : buttonface solid 1px; 
-       border-right  : buttonface solid 1px; 
-       border-top    : buttonface solid 1px;
-       visibility    : hidden;
-       left          : 0;
-       top           : 0;
-}
-
 .tb_icon {
        position : absolute;
-       width    : 22;
-       height   : 22;
-       left     : -1;
-       top      : -1;
+       width    : 22px;
+       height   : 22px;
+       left     : -1px;
+       top      : -1px;
 }

 .icon_down {
@@ -58,8 +47,8 @@
        border-right  : <%editor_base_color%> solid 1px;
        border-top    : <%editor_base_color%> solid 1px;
        top           : 1px;
-       height        : 22; 
-       width         : 23;
+       height        : 22px;
+       width         : 23px;
 }

 .menu_item_mouseoverup {
@@ -110,22 +99,22 @@
        position         : absolute;
        background-color : #C0C0C0;
        height           : 22px;
-       top              : 2;
-       font             : 8pt verdana,arial,sans-serif
+       top              : 2px;
+       font             : 8pt Verdana,Arial,sans-serif;
        border           : none;
 }

 .tb_text_mouseover {
        background-color : #C0C0C0;
        height           : 20px;
-       top              : 2;
+       top              : 2px;
        font-family      : "MS Sans Serif";
        font-size        : 6pt;
        border-bottom    : buttonhighlight solid 1px;
        border-left      : buttonshadow solid 1px;
        border-right     : buttonhighlight solid 1px;
        border-top       : buttonshadow solid 1px;
-       height           : 17;
+       height           : 17px;
 }

 .tb_handle {
@@ -147,44 +136,8 @@
        border-left      : buttonhighlight solid 1px;
        border-right     : buttonshadow solid 1px;
        border-top       : buttonhighlight solid 1px;
-       visibility       : hidden;
        height           : 25px;
-       top              : 0;
-       left             : 0;
-}
-
-.toolbar_hidden {
-       position   : absolute;
-       display    : none;
-       height     : 1px;
-       top        : 0;
-       left       : 0;
-}
-
-.context_menu {
-       position         : absolute;
-       display          : none;
-       visibility       : visible;
-       width            : 100;
-       background-Color : menu;
-       z-index          : 10
-       border           : outset 3px gray;
-}
-
-.menuItem {
-       font-family      : sans-serif;
-       background-Color : menu;
-       font-size        : 10pt;
-       width            : 100;
-       padding-left     : 20;
-       color            : black;
+       top              : 0px;
+       left             : 0px;
 }

-.highlightItem {
-       font-family      : sans-serif;
-       font-size        : 10pt;
-       width            : 100;
-       padding-left     : 20;
-       background-Color : highlight;
-       color            : white;
-}
Index: common/editor_toolbar.js
===================================================================
RCS file: common/editor_toolbar.js
diff -N common/editor_toolbar.js
--- common/editor_toolbar.js    17 Dec 2001 03:20:25 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,470 +0,0 @@
-/*
- * =================================================================
- * HTML Editor - A wysiwyg web based editor for IE5+
- *    Website  : http://gossamer-threads.com/
- *    Author   : Scott Beck sbeck@gossamer-threads.com
- *    Revision : $Id: editor_toolbar.js,v 1.2 2001/12/17 03:20:25 sbeck Exp $
- *
- * Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
- * Redistribution in part or in whole strictly prohibited. Please
- * see About file for full details.
- * =================================================================
- *
- * Description: Functions for the editor toolbars.
- */
-
-function init_images () {
-/* ---------------------------------------------------------
- * Preloads images and sets the URL for all the images on 
- * the page. If you add other images be sure they are in
- * the directory you set above.
- * This sets the onload event for the images to be displayed.
- */
-
- // If we are initialized return
-       if (this.images_init) return true;
-       this.debug ("Initializing Images");
-       for (var i = 0; i < document.images.length; i++) {
-               image = document.images[i];
-
-// Images are hidden untill the toolbar is loaded
-               image.style.visibility = 'hidden';
-
-// Do not load images of toolbars that are deleted
-               var pb = image.parentElement.title;
-               var tb = image.parentElement.parentElement.title;
-               if (this.tb_delete[tb] || this.tb_delete[pb]) {
-                       IMAGES_LEN++;
-                       continue;
-               }
-
-// Set the image source
-               var old_src = image.src;
-               image.src = old_src;
-       }
-       this.images_init = true;
-       return true;
-}
-Editor.prototype.init_images = init_images;
-
-function init_toolbar () {
-/* ---------------------------------------------------------
- * Should be called after the document has loaded. 
- * Initializes the Toolbar for display.
- */
-// Toolbar handler
-
-       if (this.toolbar_init) return true;
-       this.debug ("Initializing toolbar");
-       var i, s, element;
-       this.tb = {};
-       var tbs = document.body.all.tags ("DIV");
-       var tbs_len = tbs.length;
-
-// Go therough the document and get the toolbar classes
-       for (i=0; i < tbs_len; i++) {
-               element = tbs[i];
-
-// Store all the toolbar elements
-               this.tb[element.title] = element;
-
-// The toolbars are hidden till the images are loaded
-               element.TB_INDEX  = this.toolbars.length;
-
-// Skip deleted toolbars
-               if (this.tb_delete[element.title]) {
-                       element.className = 'toolbar_hidden';
-                       continue;
-               }
-
-// Initialize each toolbar
-               if (!this.tb_init (element)) {
-                       this.error ("Could not initialize toolbar:", element.title);
-               }
-
-// Set progmaticaly hidden toolbars to hidden
-               if (this.tb_hide[element.title]) {
-                       element.className = 'toolbar_hidden';
-               }
-
-// Keep all the toolbars for resizing and hidding
-               this.debug ("Adding toolbar", element.title);
-               this.toolbars[this.toolbars.length] = element;
-       }
-
-       this.tb_layout();
-
-// If the window is resized we need to re-layout the 
-// toolbar.
-       window.onresize = function () { This.tb_layout() };
-       this.toolbar_init = true;
-}
-Editor.prototype.init_toolbar = init_toolbar;
-
-
-function tb_init_button (element) {
-/* ---------------------------------------------------------
- * Sets op all the defaults for a button DIV. Saves any 
- * onclick and detaches the event. OnClick events are called
- * onMouseDown.
- */
-       if (element.className == "tb_general") return true;
-
-// Set events
-       element.onmouseover   = function () { This.tb_mouseover () }
-       element.onmouseout    = function () { This.tb_mouseout  () }
-       element.onmousedown   = function () { This.tb_mousedown () }
-       element.onmouseup     = function () { This.tb_mouseup   () }
-
-// Disable events
-       element.ondragstart   = function () { This.cancel_event () };
-       element.onselectstart = function () { This.cancel_event () };
-       element.onselect      = function () { This.cancel_event () };
-
-// Save onClick event for onMouseDown
-       element.YUSERONCLICK  = element.onclick;
-       element.onclick       = function () { This.cancel_event () };
-
-// Initial state is enabled
-       element.state = 'enabled';
-
-// If it is a toggle set the initial state.
-       if (element.TB_TYPE == 'toggle') element.tb_state = 'off';
-
-// So we don't re-initialize
-       element.INITIALIZED  = true;
-
-       return true;
-}
-Editor.prototype.tb_init_button = tb_init_button;
-
-function tb_init (element) {
-/* ---------------------------------------------------------
- * Called for each toolbar DIV. Populates the toolbar and 
- * sets the width.
- */
-       element.TBWidth = 0;
-       if (! this.tb_populate (element)) return false;
-       element.style.posWidth = element.TBWidth;
-       return true;
-}
-Editor.prototype.tb_init = tb_init;
-
-function tb_show (menu) {
-/* ---------------------------------------------------------
- * Shows or hiddes a toolbar. The element passed in is the 
- * toolbar object to toggle.
- */
-       var title = menu.title;
-       if (!this.tb[title]) return;
-       if (menu.className == 'toolbar_hidden') {
-               menu.className        = 'toolbar';
-               menu.style.visibility = 'visible';
-       }
-       else {
-               menu.className        = 'toolbar_hidden';
-               menu.style.visibility = 'hidden';
-       }
-       this.tb_layout();
-       return this.cancel_event();
-}
-Editor.prototype.tb_show = tb_show;
-
-function tb_populate (y) {
-/* ---------------------------------------------------------
- * Moves all a toolbar "y"'s icons to the proper location on
- * the screen and sets the correct size for the toolbars.
- */
-       var i, elements, element;
-
-       this.debug ("tb_populate called for", y.title);
-
-       elements = y.children;
-       if (!elements) return;
-
-// Loop through all the toolbars children.
-       for (i=0; i < elements.length; i++) {
-               element = elements[i];
-               if (element.tagName == "SCRIPT" || element.tagName == "!") continue;
-
-// Switch to see what element we are workin with.
-               switch (element.className) {
-
-// Menu Item then initialize it if it is not initialized.
-                       case "tb_menu_item":
-                               if (element.INITIALIZED == null) {
-                                       if (! this.tb_init_button (element)) return this.error ("Problem initializing:", element.title);
-                               }
-                               element.style.posLeft = y.TBWidth;
-                               y.TBWidth += element.offsetWidth + 1;
-                               break;
-
-// Toolbar element that is not a button
-// most likly a form field.
-                       case "tb_general":
-                       case "tb_menu_text":
-                               element.style.posLeft = y.TBWidth;
-                               y.TBWidth += element.offsetWidth + 5;
-                               break;
-
-// Seperator
-                       case "tb_sep":
-                               element.style.posLeft = y.TBWidth + 2;
-                               y.TBWidth += 5;
-                               break;
-
-// Handle for the toolbar, would be cool if people 
-// could move the toolbar. Next version :)
-                       case "tb_handle":
-                               element.style.posLeft = 2;
-                               y.TBWidth += element.offsetWidth + 7;
-                               break;
-
-// Should never get here unless the html is messed
-                       default:
-                               return this.error ("Invalid class:", element.className,"on Element:", element.id, "<", element.tagName, "> title: <", element.title, ">");
-               }
-       }
-
-// Plus one in case the width is zero
-       y.TBWidth += 1;
-       this.debug ("Toolbar width set to", y.TBWidth);
-       return true;
-}
-Editor.prototype.tb_populate = tb_populate;
-
-function tb_layout () {
-/* ---------------------------------------------------------
- * Layouts the toolbar on the screen based on the screen
- * width and the widths built in tb_populate().
- */
-       this.debug ("Layout called.");
-
-       var num_tb = this.toolbars.length;
-
-// No toolbars
-       if (num_tb == 0) { this.debug ("Ack, no toolbars"); return }
-       var i;
-
-// Get the screen width minus the width of the scrollbar
-       var sbar = document.body.offsetWidth - document.body.clientWidth;
-       var ScrWid = (document.body.offsetWidth  - sbar);
-       var ScrHit = (document.body.offsetHeight - sbar);
-
-// Go through the toolbars and find the width of the widest
-// one.
-       var TotalLen = ScrWid;
-       var tb = [];
-       var e = 0;
-       for (i = 0; i < num_tb; i++) {
-               if (this.toolbars[i].className == 'toolbar_hidden') continue;
-               tb[e] = this.toolbars[i];
-               if (tb[e].TBWidth > TotalLen) TotalLen = tb[e].TBWidth;
-               e++;
-       }
-       e--;
-       if (!tb.length) { return; }
-       var PrevTB;
-       var LastStart = 0;
-       var RelTop = 0;
-       var LastWid, CurrWid;
-
-// Position the top toolbar to the top of the screen
-       var TB           = tb[0];
-       TB.style.posTop  = 0;
-       TB.style.posLeft = 0;
-       var rows         = 1;
-
-// Go through the toolbars and update there width
-// and position.
-       var Start = TB.TBWidth;
-       for (i = 1; i < tb.length; i++) {
-               PrevTB = TB;
-               TB = tb[i];
-               CurrWid = TB.TBWidth;
-
-// Reached the end of the screen, reset to the start
-               if ((Start + CurrWid) > ScrWid) { 
-                       Start = 0;
-                       rows++;
-                       LastWid = TotalLen - LastStart;
-               }
-               else {
-                       LastWid = PrevTB.TBWidth;
-                       RelTop -= TB.offsetHeight;
-               }
-         
-               TB.style.posTop = RelTop;
-               TB.style.posLeft = Start;
-               PrevTB.style.width = LastWid;
-
-               LastStart = Start;
-               Start    += CurrWid;
-
-       }
-       DHTMLSafe.style.posTop     = (rows * 25);
-       DHTMLSafe.style.posHeight  = ScrHit - (rows * 25) - 5;
-       DHTMLSafe.style.posWidth   = ScrWid - 5;
-       DHTMLSafe.style.visibility = 'visible';
-
-// Set the total width
-       TB.style.width = TotalLen - LastStart;
-
-// Move the rest of the toolbars down
-       i--;
-       TB = tb[i];
-       var TBInd = TB.sourceIndex;
-       var A = TB.document.all;
-       for (var i in A) {
-               var item = A.item(i);
-               if (! item)                    continue;
-               if (! item.style)              continue;
-               if (item.sourceIndex <= TBInd) continue;
-               if (! this.tb[item.title])     continue;
-               if (item.className == 'toolbar_hidden')  continue;
-               item.style.posTop = RelTop;
-       }
-}
-Editor.prototype.tb_layout = tb_layout;
-
-function tb_mouseover () {
-/* ---------------------------------------------------------
- * OnMouseOver event handler function for toolbar buttons.
- */
- // Source must be an image
-       if (event.srcElement.tagName != "IMG")  return this.cancel_event();
-       var image   = event.srcElement;
-       var element = image.parentElement;
-
-// If we are in text mode and the button is disables for 
-// text mode. cancel the mouseover.
-       if (element.state == 'disabled') return this.cancel_event();
-
-// If the image in normal state put it in mouseover state
-       if (image.className == "tb_icon") { 
-               element.className = "menu_item_mouseoverup";
-       }
-
-// else if it is in down state put it in mouseover
-// for down states.
-       else if (image.className == "icon_down") {
-               element.className = "menu_item_mouseoverdown";
-       }
-
-       return this.cancel_event();
-}
-Editor.prototype.tb_mouseover = tb_mouseover;
-
-function tb_mouseout () {
-/* ---------------------------------------------------------
- * MouseOut event handler function for toolbar buttons
- */
- // The source tag must be an image.
-//     this.debug ("MouseOut event caught for", event.srcElement.title);
-       if (event.srcElement.tagName != "IMG") {
-//             this.debug ("Source is not an image");
-               return this.cancel_event();
-       }
-       var image   = event.srcElement;
-       var element = image.parentElement;
-
-// IF we are in "text mode" disable mouseout and return
-       if (element.state == 'disabled') {
-//             this.debug ("Source is disabled");
-               return this.cancel_event();
-       }
-
-// If the button is a toggle update it's state.
-       if (element.TB_TYPE == 'toggle' && element.tb_state != 'off') {
-               element.className = "menu_item_mouseoverdown"
-               image.className   = 'icon_down';
-       }
-
-// else put the image back to it's normal state.
-       else {
-               element.className  = "tb_menu_item";
-               image.className    = "tb_icon";
-       }
-
-       return this.cancel_event();
-}
-Editor.prototype.tb_mouseout = tb_mouseout;
-
-function tb_mousedown () {
-/* ---------------------------------------------------------
- * MouseDown event handler for toolbar buttons.
- */
-
-       this.debug ("MouseDown event caught for", event.srcElement.title);
- // The source tag must be an image.
-       if (event.srcElement.tagName != "IMG") { 
-               this.debug ("Source was not an image"); 
-               return this.cancel_event();
-       }
-       var image   = event.srcElement;
-       var element = image.parentElement;
-
-// If we are in "text mode" and the button is not supported in
-// "text mode" cancel the event and return false.
-       if (element.state == 'disabled') { 
-               this.debug (element.title, "disabled"); 
-               return this.cancel_event();
-       }
-
-// If the button is a toggle update it's state.
-
-       if (element.TB_TYPE == 'toggle') {
-               this.debug (element.title, "is toggle. Updating toggle");
-               this.update_toggle (element, image);
-       }
-       else {
-
-// Else set the button to the mosedown state.
-               element.className = "menu_item_mouseoverdown";
-               image.className   = "icon_down";
-       }
-
-// We disabled the click function and saved it in this.
-// Eval it here and run it.
-       this.debug ("Calling code", element.YUSERONCLICK);
-       if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
-       return this.cancel_event();
-}
-Editor.prototype.tb_mousedown = tb_mousedown;
-
-function tb_mouseup () {
-/* ---------------------------------------------------------
- * MouseUp event handler function for toolbar buttons.
- */
- // The source element must be an image type.
-//     this.debug ("Caught mouseup event for", event.srcElement.title);
-       if (event.srcElement.tagName != "IMG") {
-//             this.debug ("Source is not an image");
-               return this.cancel_event();
-       }
-       var image   = event.srcElement;
-       var element = image.parentElement;
-
-// If we are in "text mode" and the field is disabled in that
-// mode return and cancel the event.
-       if (element.state == 'disabled') {
-//             this.debug ("State is disabled");
-               return this.cancel_event();
-       }
-
-// It the icons to the mouseUp state.
-       element.className = "menu_item_mouseoverup";
-       image.className   = "tb_icon";
-
-// Refocus the compose window here.
-       DHTMLSafe.focus();
-
-       return this.cancel_event();
-
-}
-Editor.prototype.tb_mouseup = tb_mouseup;
-
-/* Help VIM out
-vim:ts=4:shiftwidth=4:syntax=javascript
-*/
-
Index: common/globals.txt
===================================================================
RCS file: common/globals.txt
diff -N common/globals.txt
--- common/globals.txt  16 Dec 2001 21:30:23 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,7 +0,0 @@
-# This file is auto generated and contains a perl hash of
-# your template globals for 'default' template set.
-# Generated on: Sun Dec 16 13:25:10 2001
-# vim: syn=perl
-{
-       'editor_base_color' => '#E6F5D7'
-}