##################################################################################################
##                                                                                  Release 1.6 ##
##      x-forum.cgi                                                                 April 2001  ##
##                                                                                              ##
##                 Copyright (c) 2001 Diederik van der Boor - All Rights Reserved.              ##
##                                                                                              ##
##                 Originally published and documented at http://www.codingdomain.com           ##
##                 License to use is granted if and only if this                                ##
##                 entire copyright notice is included.                                         ##
##                                                                                              ##
##                 I like to maintain a list of implementations around the world,               ##
##                 and I'll properly let you know if something has changed, or bugs show up.    ##
##                 So just mail me at webmaster@codingdomain.com                                ##
##                                                                                              ##
##                                                                                              ##
##################################################################################################



   Contents:

   - Description of X-Forum and Coding Domain
   - Features
   - Microsoft IIS notes
   - Installing
   - Support Locations



   Description:

    The X-Forum bulletin board is a free bulletin board,
    which can be used for every kind of website.

    Many powerfull features, which include guests posting limitations,
    reply e-mail notification for members, many moderating tools. All these features
    are developed keeping importance of security in mind.

    Easy to install; File paths are automatically detected, and there are no
    settings that need to be updated before uploading.
    
   Coding Domain:
    Coding Domain offers CGI Scripts, Perl samples and tutorials and
    useful programming in Windows using Visual Basic (also utilizing the windows API).



   X-Forum Features:

   << General >>
   - Using subjects and flat-style-topics to make discussions easy to follow and respond to
   - Markup (sortof UBBC Codes) and graphical-smileys in posts
   - Setting files, Language Packs and Template files!
   - Only Members can write new posts, quote other posts and modify their own posts.

   << Members >>
   - Member Accounts and containing optional information
   - Optionally you can enter your ICQ, AIM, YIM, MSN, Website, Gender, Country, Birthday, Timezone
   - Member Signatures, placed under each post, can contain markup codes.
   - Users Online list
   - Member avatar image folder, personal URL's are also allowed as avatar
   - Context help, for every screen a different help window is avaible
   - Instant Messenging
   - E-mail reply notification

   << Administration >>
   - Administrator Control Center
   - Moderators can be assigned to subjects 
   - Ability to delete posts, modify posts and member accounts
   - Ability to move, lock and delete entire topics
   - Ability to make sticky topics
   - Making private subjects that are restricted to some member groups
   - Banning of member's, IP's and IP blocks
   - Deleting member profiles
   - Changing all member passwords
   - Words can be censored automatically
   - Logging of member action's, events and Network IP's
   - Forum Maintaince mode; The administator can close the forum
   - Post flood protection; A member can't post shortly after the previous post
   - Repairing all database files
   - Editing the settings and template

   << Techies Details >>
   - Script automatically detects it's URL and it's location at the webhost (can be overruled!)
   - Passwords are never hard-coded in text files, thanks to some encryption methods
   - Directory hiarchy for data files





   
   Microsoft Internet Information Server notes:

   - There are some minor differences when running this program under
     the Microsoft Internet Information Server, or running it under some Unix/Linux webserver.
     Sometimes you have todo something extra (or not) when running Ms-IIS.
   - Note the !!UNIX!! and !!MS-IIS!! tags.
   - Important things to know
     - MS-IIS version below 5.1:  The x-modules directory should be located at the www-root
     - Perl version below 5.6:    Topic replying can be slow when notification e-mails
                                  have to be sent, since X-Forum can't do the topic reply
                                  and e-mailing together using a perl verion below 5.6.
                                  Disable the e-mail functions is this is a huge delay to posting.



   Installing:

   - Steps
     1. Check the requirements
     2. Extracting all the files from the archive
     -  Getting an administrator password (can be done later aswell)
     3. Uploading the files
     4. Setting file system permissions
     5. Try to run the forum from the webbrowser
        If any errors occur, fix them first.
     6. Sign up; even administrators have to sign up!!!!
     7. Create subjects, and test if new topics can be created.
     8. Change the preferences, admin password and template if you wish.




   Install Step 1: Requirements:

   - A webserver (personal or remotely hosted)
   - Free diskspace; at least 1 MB, 3 MB recommended.
   - CGI support; Server has to allow/be able to run *personal* CGI programs.
   - Perl 5.005 installed for processing CGI scripts.
   - Perl modules: CGI, Fcntl, and the encryption functions should be complied within perl aswell.
   - Optional (!) E-mail functionality:
     - sendmail (UNIX mostly)
     - OR the Net::SMTP module (Win32 mostly).
   - Some brains ;-)
   

     
   
   
   Install Step 2: Extracting

   - Extract the files from the compressed archive using the "Create Directories"
     option ON. Within the archive, a directory structure is already defined.
   - If you wish to edit the settings before uploading, please check step 8.




   Install Step 3: Uploading:

   - Images (*.gif and *.jpg files) should be uploades as BINARY files.
   - All other files need to be uploaded in ASCII format.
   - Settings and the administrative password can be changed later at any time
   - Theoretically, you only have to copy the directory structure
     with all files in it, to make it work.
   - Make a directory structure, if your FTP program doesn't do this automatically
     
     * Inside the cgi-bin *
     cgi-bin
     cgi-bin/x-codelibs
     cgi-bin/x-codelibs/forum
     cgi-bin/x-data
     cgi-bin/x-data/forum/groups
     cgi-bin/x-data/forum/logs
     cgi-bin/x-data/forum/members
     cgi-bin/x-data/forum/messages
     cgi-bin/x-data/forum/posts
     cgi-bin/x-data/forum/settings
     cgi-bin/x-data/forum/subjects
     cgi-bin/x-data/forum/topics
     cgi-bin/x-languages
     cgi-bin/x-languages/forum
     cgi-bin/x-languages/forum/english	(language name; ie english)

     You can also use a different folder then the CGI bin, like cgi-bin/x-forum
     All those files that would normally be stored inside the cgi-bin, should
     then be stored in that other folder.

     
     * Outside the cgi-bin *
     xf-libaries
     x-images
     x-images/folders
     x-images/icons
     x-images/membericons
     x-images/posticons
     x-images/smileys
     x-images/subjecticons
     x-images/topicicons
     x-images/treelevel
     x-images/ubbc
     
     * In perl/lib or cgi-bin/x-modules or www-root/x-modules *
     - Defaultly, put this directory indide the cgi-bin.
     - If you have root access to your webserver, you can put the directories
       inside the x-modules into the perl/lib folder.
     - !!MS-IIS!! It should be located at the WWW-root directory
                  if your server runs 'MS IIS'.
     x-modules
     x-modules/CGI
     x-modules/File
     x-modules/HTML
     x-modules/INet
     x-modules/Net
     x-modules/Test
     x-modules/Time
     x-modules/Test/Text
     x-modules/Test/Zones
   


   
   Install Step 4: File Permissions

     !!UNIX!! File permissions don't need to be set for windows servers.
              For UNIX servers however, you need to allow programs to change files.


     - All the data directories inside the cgi-bin needs to have
       the permission mode 777. Sometimes 766 is used for some systems.
     
    
     Here is a list of all files, including the file permissions.
     - When omitted, you may leave it as it is (644), or set it to 646 or 666.
     - There are some alternatives to the permissions for some systems.
       It's recommended to use them if that doens't cause any errors in X-Forum.
     - Many files can be edited from the "Admin Center: Edit Files" aswell
       when set permissions are set to 666 or 646 or 646.
     
     | file name                    | permission mode |
     ==================================================
     cgi-bin/				
         x-forum.cgi			755 or 777
         xf-settings.pl			666 or 646 or 644	- Don't overwrite when upgrading!!
         x-codelibs/
             .htaccess
             forum/
                 .htaccess
                 *.pl
         x-data/			777 or 766 or 646
             forum/			777 or 766 or 646
                 .htaccess
                 groups/		777 or 766 or 646
                     .htaccess
                 logs/			777 or 766 or 646
                     .htaccess
                 members/		777 or 766 or 646
                     .htaccess
                 messages/		777 or 766 or 646
                     .htaccess
                 posts/			777 or 766 or 646
                     .htaccess
                 settings/		777 or 766 or 646
                     .htaccess
                     xf-template.html	666 or 646 or 644	- Don't overwrite when upgrading!!
                     english.cen	666 or 646 or 644	- Don't overwrite when upgrading!!
                     ips.ban		666 or 646 or 644	- Don't overwrite when upgrading!!
                     members.ban	666 or 646 or 644	- Don't overwrite when upgrading!!
                     default.cfg
                     logactions.cfg
                     ubbccodes.cfg
                 subjects/		777 or 766 or 646
                     .htaccess
                 topics/		777 or 766 or 646
                     .htaccess
         x-languages/
             forum/
                 .htaccess
                 english.lang
                 english/
                     .htaccess
                     *.hlp
     x-images/
         (all images and folders herein)			- Upload as binary!!
     xf-libaries/
         style.css
         input.css
         ubbs.js
     x-modules/
         CGI/
             ErrorTrap.pm
             Location.pm
             Template.pm
         File/
             PlainIO.pm
         HTML/
             EscapeASCII.pm
         INet/
             Mailer.pm
         Net/
             Cmd.pm
             Config.pm
             Domain.pm
             SMTP.pm
         Test/
             Input.pm
             IPAddress.pm
         Time/
             Text.pm
             Text/
                 English.pm
             Zones.pm
             Zones/
                 English.pm




   Install Step 5: Activate the forum

   - Run the CGI program from the webbrowser, ie
     goto: http://www.yourwebsite.com/cgi-bin/x-forum.cgi
   - It should work now, although you might get some errors
     if you forget a file permission, or forgot to upload a file.
     Please read through the previous steps again to see if you missed
     something. If the error isn't a HTTP error, but an error page
     generated by X-Forum, check the error message to see what's wrong.
   

   

   Install Step 6: Sign up

   - You need to SIGN UP (not login) as administrator:
     - Display Name    :    Your nickname, that other users will see.
     - E-mail          :    Your e-mail address where all forum e-mails will be sent to
     - Login Name      :    admin
     - Choose Password :    adminenter (unless you changed it before)
   - After a successful signup, you will automatically login,
     and you can fill in a detailled user-profile if you wish.




   Install Step 7: Create Subjects and Topics

   - Press "Admin" at the toolbar. The administrator control panel appears.
   - From there, you can create new subjects.
   - Using the "Re-sort Subjects" option you can insert labels
     before a group of subjects aswell.



   Install Step 8: Change the preferences and template

   - Settings:
     - You can change the settings from the Admin Center in the forum.
     - This requires having edit permissions at the xf-settings.pl file.
     - The settings can also be edited manually by editing the xf-settings.pl file.
   - Templates:
     - You can change the template from the Admin Center in the forum
     - You can also change the data manually. (edit /cgi-bin/x-data/forum/settings/xf-template.html)
     - Note the %XFORUM::VARIABLE% labels in the template. You can't remove or subsitute all of them.
     - Make sure the %XFORUM::HEADER% label won't be removed from the HTML <HEAD>..</HEAD> tags. 
   - Changing the administrator password:
     Since all the passwords used in the X-Forum script are crypt,
     the Administrator password is stored crypt as well.
     - Choose the "Change Password" option from your member profile (admin)
         OR
       Go to http://www.codingdomain.com/cgi-perl/downloads/x-forum/newpass.html
       to generate a new password.
     - The generated password should be inserted into the xf-settings.pl file.




   Support Locations:

   - Coding Domain WebSite  : http://www.codingdomain.com/
   - Coding Domain E-mail   : webmaster@codingdomain.com

   - Online Community       : http://www.codingdomain.com/cgi-bin/x-forum.cgi
   - Contact Form           : http://www.codingdomain.com/ui-pages/email.html
   - Bug Reports            : http://www.codingdomain.com/ui-pages/bugreport.html

   - Installing X-Forum     : http://www.codingdomain.com/cgi-perl/downloads/x-forum/install/
   - Installing CGI Scripts : http://www.codingdomain.com/cgi-perl/articles/install.html

   - Downloading X-Forum    : http://www.codingdomain.com/cgi-perl/downloads/x-forum/
   - Generate a Password    : http://www.codingdomain.com/cgi-perl/downloads/x-forum/newpass.html

   - Rating @ script index  : http://jp0013/cgi-perl/downloads/x-forum/rate.html




   Thank you for using this forum, and taking the time to read this file.
   If you run into any problems, or have any suggestions,
   please visit one of the support locations


   http://www.codingdomain.com
   webmaster@codingdomain.com
   
      Diederik van der Boor.