home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / bbs / tpbbs10.ark / TPBS10.DOC next >
Encoding:
Text File  |  1986-09-14  |  21.0 KB  |  465 lines

  1.  
  2.  
  3.  
  4.  
  5.                           << T P B B S >> 
  6.                   Turbo Pascal Bulletin Board System
  7.  
  8.                                 by
  9.                     James Whorton - OBBS sysop
  10.                     Eddie H. Curlin - BOS sysop
  11.  
  12.  
  13.           Note:     TPBBS has been placed into the public
  14.                     domain by the authors. Feel free to use
  15.                     and modify this program in any way.
  16.  
  17.  
  18.    TPBBS,  as  its name implies,  is a bulletin board system written wholly in 
  19.    Turbo  Pascal (c).  Turbo Pascal is a copyright of  Borland  International, 
  20.    Scotts Valley, CA.
  21.  
  22.     Turbo  Pascal  was  chosen  as  the  programming  language  because  it  is 
  23.    inexpensive and easy to use. For these reasons, we feel that TP is going to 
  24.    come  on strong in the microcomputer world.  With this in mind,  TPBBS  was 
  25.    written  to help show what TP is capable of.  (Note:  we realize that  this 
  26.    system is not anywhere near perfection, or rather what we're aiming for, so 
  27.    rest assured that there will be more versions on the way. JW)
  28.    TPBBS is distributed as a library of files.  As currently set up, there are 
  29.    eight (8) files in the TPBBS10.LBR.  All of these are required by the TPBBS 
  30.    system. The included files are as follows:
  31.  
  32.              TPBBS10.DOC  > Document file for TPBBS ver 1.0
  33.              TPINIT10.PAS > BBS initialization for ver 1.0
  34.              TPUTIL10.PAS > sysop's utility program
  35.              TPBBS10.PAS  > main program of BBS ver 1.0
  36.              TPMESG10.PAS > message subsystem ver 1.0
  37.              TPFUNC10.INC > common functions used in both TPBBS and TPMESG
  38.              TPMENU       > BBS main menu file
  39.  
  40.    This  documentation  will lead you,  step-by-step,  through  the  necessary 
  41.    changes to customize the TPBBS to your own system. All of these changes are 
  42.    cosmetic, the system will run without making any changes.
  43.  
  44.  
  45.    TPBBS  is  a full-featured bulletin board system written in  Turbo  Pascal. 
  46.    Turbo  Pascal  (TP) is a highly structured programming language by  Borland 
  47.    International.  Using  TP required that the TPBBS be written in  a  modular 
  48.    form. The various modules make updating and upgrading the system easier. If 
  49.    you want to add a function, you only need to make the change in a couple of 
  50.                                       1
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.    modules and then re-compile the program.
  60.     First  a  short  explanation  of  the items you  will  need  to  change  to 
  61.    personalize the BBS system to your own individual BBS.
  62.  
  63.    TPINIT10.PAS
  64.    ------------
  65.    This file sets up various files that the BBS expects to find on your  disk. 
  66.    (ie USER,  COUNTERS,  COMMENTS,  CALLER). TP has its own format for writing 
  67.    random  access files to disk.  You cannot set these up using a normal  text 
  68.    editor. Therefore, you MUST run TPINIT in order to start the files. Failing 
  69.    to do this will cause the TPBBS to abort with an error message.
  70.     TPINIT  contains  some  information  that  must  be  changed  to  your  own 
  71.    parameters.  In the constant definition area (beginning of file) there is a 
  72.    provision  for  allowing  sysop to add an .EXT to his  file  names.  Change 
  73.    (EXT:='')  to a period followed by whatever three-character  extension  you 
  74.    wish to use. (i.e. '.EXT')
  75.  
  76.    A few lines farther down there are some identifiers for your system.  These 
  77.    are really used as data for setting up the user file.
  78.    Change (Name:='Whatever your system name is')
  79.    Change (Address:='Your City, Your State')
  80.    Change (Lastdate:='Startup date for your system')
  81.  
  82.    TPBBS10.PAS
  83.    -----------
  84.    In  the  declaration  section of this file and RBBSMESG there  are  several 
  85.    options which should be set according to your wishes.
  86.     label          description
  87.    -------------  ------------------------------------
  88.    system         Your system name.
  89.    drive1         Drive that BYE, or other sign-off 
  90.                   program, is on.
  91.    drive2         Drive that contains WELCOME, BULLETIN,
  92.                   COUNTERS, USER, etc.
  93.    drive3         Drive that contains the message system
  94.                   files (SUMMARY, MESSAGES, etc.).
  95.    ext            An optional extension for your system
  96.                   files, such as '.EXT'.
  97.    syspass1       Qwik CP/M access logon code.
  98.    syspass2       Sysop's password.
  99.    opencpm        CP/M access switch, true=unlimited
  100.                   access, false=queried access. (To keep
  101.                   out twits).
  102.    query          CP/M access query.
  103.    answer         CP/M access query answer.
  104.    clock          If you don't have a real-time clock,
  105.                   set this to false, else set to true
  106.                   and install your routines to get the
  107.                   time and date in the getdate and get-
  108.                   time procedures in TPFUNC.INC.
  109.                                        2
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.    NOTE:  the  ENTIRE  declaration section in TPBBS and TPMESG  must  be  kept 
  119.    EXACTLY  the same,  else you will experience wierd results as the variables 
  120.    fail to pass on chaining from one to the other.
  121.    THE SYSTEM SOFTWARE
  122.    -------------------
  123.    The  TPBBS  system  is written in a modular form.  The next  section  is  a 
  124.    description of how each module fits into the system.  (suggestion :  have a 
  125.    printout  of the files as you read through this so you may follow along  as 
  126.    each procedure is explained.)
  127.  
  128.     TPFUNC.INC
  129.    This  file contains general purpose routines that are common to both  TPBBS 
  130.    and TPMESG programs. If you wish to add functions, you should add them into 
  131.    this set of common routines.
  132.  
  133.    STUPCASE  -This  is  a function that will change the string  input  as  an 
  134.    argument into all UPPERCASE characters.  Format for entering this function 
  135.    is: STUPCASE(nstring) where nstring is any string to be converted.
  136.  
  137.    MAKENUM -This procedure converts the string in <bstring> to an integer and 
  138.    returns it in <x>.  If the procedure detects an error it will set x=30000. 
  139.    You do not pass any parameters when calling this procedure.
  140.  
  141.    PAD  -procedure will 'pad' a string with spaces and return that string  in 
  142.    <temp>.  Format for use is PAD(input,padlength), where input is the string 
  143.    to  be  padded and padlength is the finished length of  the  string.  This 
  144.    procedure  maintains  a standard length on all message input and  comments 
  145.    input.
  146.  
  147.    PPROMPT -This procedure will prompt user for a Yes or No answer and places 
  148.    their reply in <dd>.  This procedure is used by the paginating function of 
  149.    the BBS.  (keeps text files from scrolling off screen before user can read 
  150.    them). Pass no parameters when calling.
  151.  
  152.    GTLN -restricts the users input to prompts and messages to a maximum size. 
  153.    (currently set at 62 char per line) Used by the getstring procedure.
  154.  
  155.    PRINTSTRING  -prints the string assigned to <line> or  <line1>.  If  using 
  156.    <line>  will print a carriage return,  line feed after its output,  but on 
  157.    <line1> will not print carriage return or line feed.  This allows printing 
  158.    text  using <line> and questions or prompts using <line1> (users  response 
  159.    on same line).
  160.  
  161.    GETSTRING  -all user input is channeled through this procedure.  It allows 
  162.    chaining  commands  at the prompts and it accepts input for  messages  and 
  163.    comments. You pass no parameters during calls to this procedure.
  164.  
  165.    BYEBYE  -this  procedure  is the one called when the  user  enters  a  'G' 
  166.    command  to leave the system.  BYEBYE prints a message and then clears the 
  167.    jump at address 00Hex and immediately runs BYE.COM
  168.  
  169.    GETCPM  -is  executed if the user has requested CPM and then  entered  the 
  170.    correct password.  GETCPM prints a 'help' file if located on disk and then 
  171.                                      3
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.     resets the jump at address 00Hex. GETCPM then performs a warm boot to take 
  181.     the user to CPM.
  182.  
  183.     ENTR_COMMENT  -is  executed if user types either 'G' or  'C'  (goodbye  or 
  184.     CPM).  It  allows  the user to enter private comments to the sysop of  the 
  185.     system.  Procedure ENTR_COMMENT allows a max of 15 lines of 62  characters 
  186.     to be entered and stored to disk.  After giving the user an opportunity to 
  187.     enter  comments,  the procedure will branch to either the BYEBYE or GETCPM 
  188.     procedures, depending on the condition of 'flag'.
  189.  
  190.     GOODBYE -executed on 'G' command. Makes the choice of entering comments or 
  191.     not.
  192.  
  193.     EXIT_TO_CPM -If opencpm=false,  asks query and gives the user 3 chances to 
  194.     reply  correctly.  If  unable  to do so,  logs  him  off  the  system.  (I 
  195.     implemented this to discourage non-CP/M users from tying up the system for 
  196.     an  afternoon trying to gain access,  as it is assumed that the query will 
  197.     relate  to some command or aspect of CP/M.) If the right reply  is  given, 
  198.     asks  for  comments,   allows  entry  if  any,   then  calls  GETCPM.   If 
  199.     opencpm=true, skips the query and continues as above.
  200.  
  201.     PRNTUSER -list the current user file. Will list only the Name, Address and 
  202.     Last  date on-line to the users CRT.  PRNTUSER preserves the integrity  of 
  203.     the users passwords located in USER file.
  204.  
  205.     TPBBS.PAS
  206.     It  contains most of the routines used,  with the exception of the  message 
  207.     file.  The  first portion of this file contains the various definitions  of 
  208.     the variables and constants used throughout the program.
  209.  
  210.     The balance of the file contains the necessary procedures to run the TPBBS.
  211.  
  212.     PRNTTEXT -procedure to print out on screen any ASCII type file. Will print 
  213.     the  normal  files such as 'BULLETIN',  'WELCOME',  'NEWUSER' or other  as 
  214.     assigned by the sysop.
  215.  
  216.     LIST_STATS  -this  procedure is called by command 'L' or  by  the  sign-on 
  217.     module.  It  will list the last date that the user was on-line,  with  the 
  218.     last  high  message,  plus it lists the current information for number  of 
  219.     messages, high message number, and the caller number.
  220.  
  221.     DO_COMMAND  -this  is a simple procedure to take the  command  entered  in 
  222.     'GET_COMMAND'  and pass the program control to the appropriate area.  Some 
  223.     commands  are  handled internal to DO_COMMAND,  while some  (such  as  the 
  224.     message system) branch outside this procedure. This is where modifications 
  225.     must go to use a new command.
  226.  
  227.     GET_COMMAND  -Prints a 'Function:  ' prompt and if not set at EXPERT level 
  228.     will  add  the  menu  choices.  The  user  then  enters  his  choice,  and 
  229.     GET_COMMAND will act to validate the command. If it does not recognize the 
  230.     input as a valid command, it gives the user a message telling him so.
  231.  
  232.     LOGIN -does the initial user log-in.  If clock=false then gets the current 
  233.     date from the user,  else gets the current time and date and logs the call 
  234.     to disk.  Previous user information is retained in memory.  Procedure then 
  235.                                       4
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.     logs the callers name to the CALLER file on disk and proceeds to check for 
  245.     messages to the caller.  If messages found for this caller, he is informed 
  246.     of  such and the message number,  with a request to delete after he  reads 
  247.     it.
  248.  
  249.     NEWUSER -If caller has not been previously entered in the USER file, he is 
  250.     transferred  to NEWUSER where he is requested to enter the city and  state 
  251.     he  is  calling from and then chooses a  password.  After  validating  the 
  252.     password,  the procedure prints a file titled "NEWUSER" if on the disk. It 
  253.     then calls the LOGIN procedure to complete the sign-on.
  254.  
  255.     SIGNON -This procedure will get the users first name and last name. Checks 
  256.     to  see  if a current user and if he is,  then requests his  password.  If 
  257.     password is incorrect according to the user file,  after three (3)  tries, 
  258.     the  caller is disconnected.  If the password was entered  correctly,  the 
  259.     program  continues  by  going to LOGIN procedure and  proceeds  from  that 
  260.     point.
  261.  
  262.     Following the SIGNON procedure is the main body of the program. First, the 
  263.     CTRL-C  is killed,  making it impossible for the user to break out of  the 
  264.     program  without  the  proper sequence of events.  Then  some  basic  user 
  265.     parameters are set, along with the passwords selected by the sysop.
  266.     Finally,  the  program starts communicating with the remote  computer  bye 
  267.     making  an introduction then printing a text file called  "WELCOME".  Then 
  268.     the SIGNON procedure takes over and gets the names, etc, and turns control 
  269.     over to GET_COMMAND.  From there,  it is just a series of loops around the 
  270.     GET_COMMAND and DO_COMMAND procedures until the user decides to get out by 
  271.     BYEBYE or GETCPM.
  272.  
  273.     TPMESG.PAS
  274.     This  is  the  messaging subsystem for the TPBBS  version  1.0.  This  file 
  275.     contains all the necessary procedures for handling the message commands.
  276.     The beginning of TPMESG.PAS,  again,  has all the definitions for variables 
  277.     and constants. After the definitions, you will find the various procedures.
  278.  
  279.     MSGPROMPT  -This is the prompt for messages to be acted upon by one of the 
  280.     commands (Scan,  Qwikscan,  Kill,  or Read). It simply prompts the user to 
  281.     enter a message number.
  282.  
  283.     ENTRMSG  -Allows entry of a new message.  Gets the header information  and 
  284.     checks to see if the WHOTO is a valid user of the system. If not a current 
  285.     user,  procedure  will ask the user to verify the name.  (Quick and  dirty 
  286.     spelling checker).  Also allows for password protection of the message (ie 
  287.     only sender and designated receiver may kill Private messages (of  course, 
  288.     Sysop can, also). Allows entry of 15 lines of 62 characters. At completion 
  289.     of  the  message  (ie.  two C/R's),  the user has the option  of  Listing, 
  290.     Editing,  Aborting,  Continuing, or Saving the message. A Save will update 
  291.     the counters file, summary file, and the message file. An Abort will cause 
  292.     nothing to be written to the disk.
  293.  
  294.     READMSG  -This  procedure  will allow the user to enter the  number  of  a 
  295.     message to be read. If the message is private, it will not be read and the 
  296.     user will be informed that it is a private message.  If the number is  not 
  297.     an existing message number,  the user will be informed of that fact, also. 
  298.  
  299.                                        5
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.     This procedure will loop onto itself until the user enters a response that 
  309.     it takes to be '0' or that it does not understand.
  310.  
  311.     SUMMINIT  -Called by both Summary and Qwiksummary,  this procedure accepts 
  312.     the  user's  input  for a message number to begin  the  summary.  It  then 
  313.     attempts  to validate that message number.  Upon validation,  it sets  the 
  314.     file-pointer to the beginning of the message number requested by the user.
  315.  
  316.     SUMMARIZE  -This  procedure will give the user a complete summary  of  the 
  317.     message headers from the message number requested to the end of the file.
  318.  
  319.     QWIK_SUMMARY -The same as SUMMARIZE above,  except it returns only message 
  320.     number and Subject to the user.
  321.  
  322.     KILLMSG  -Allows  the user to 'kill' a message after he has  read  it.  It 
  323.     validates the attempt before completing the kill operation.  Only the user 
  324.     who originally entered a message,  or the designated recipient are allowed 
  325.     to kill the message. (of course, the sysop retains the ability to kill any 
  326.     message  left  on  his BBS).  The killing of a  message  will  update  the 
  327.     following files: summary, message, and counters.
  328.  
  329.     GET_COMMAND  -this one is tailored to the message subsystem.  Basically it 
  330.     is  the same as GET_COMMAND in the TPBBS.PAS file except this one  relates 
  331.     to the message system.
  332.  
  333.     DO_COMMAND -again, this one is much the same as in the TPBBS.PAS file, but 
  334.     it relates to the message subsystem only.
  335.  
  336.     The  main program body follows these procedures.  It is only 6 lines long. 
  337.     This  is  simply  a loop construction to keep going  from  GET_COMMAND  to 
  338.     DO_COMMAND until the user enters an 'A' to abort back to the main program.
  339.  
  340.    TPINIT.PAS
  341.    This  program simply initializes all the files used by  the  system.  Turbo 
  342.    Pascal random-access files are different from those you may be used to with 
  343.    BASIC.  Because  of this,  Turbo Pascal cannot read the text editor created 
  344.    files as a random file.  In order to have true random capability, we had to 
  345.    generate dummy files using TPINIT.PAS.
  346.  
  347.    TPINIT will create the following files:
  348.         USER ----- using dummy information from the
  349.                    sysops input of a system name and
  350.                    address and a date of creation.
  351.         COUNTERS - setting all fields to '0'
  352.         CALLERS -- setting caller to '1'
  353.                    and the rest to null strings.
  354.         COMMENTS - setting first record to '1'
  355.  
  356.    TPUTIL.PAS
  357.    This is the sysop's utility file. It will allow the system operator to have 
  358.    complete  control  over his BBS.  Using TPUTIL,  the sysop can  update  his 
  359.    message and summary files.  This removes deleted messages,  making room for 
  360.    new messages to be entered to the board.
  361.  
  362.  
  363.  
  364.  
  365.  
  366.                                    6
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.    INSTALLATION OF TPBBS
  378.    ---------------------
  379.  
  380.    In  order  to  run TPBBS,  you must first compile  the  programs  into  the 
  381.    necessary  command  files  which  your computer  can  execute.  To  compile 
  382.    programs, you must have a working Turbo Pascal program for your system.
  383.  
  384.    TPBBS.PAS
  385.    First you must compile the TPBBS.PAS file into a .COM file.  Put a copy  of 
  386.    Turbo  Pascal into drive <A>,  and load it.  Put a copy of your  TPBBS.PAS, 
  387.    TPFUNC.INC and TPMISC.PAS into drive <B>. Now log onto drive <B>, enter the 
  388.    main  file name as TPBBS.  Choose the Options and set the parameter to .Com 
  389.    file, End address to 8000Hex and Quit. Now enter C to compile the program.
  390.     After the program is compiled,  you will have a command file that will  run 
  391.    on your system. But you must now compile the message system,TPMESG.PAS
  392.  
  393.  
  394.    TPMESG.PAS
  395.    While  Turbo  Pascal  is  still in drive <A>,  put a  copy  of  TPMESG.PAS, 
  396.    TPFUNC.INC,  and  TPMISC.PAS into drive <B>.  Enter the main file  name  as 
  397.    TPMESG and,  again, choose the Options menu. This time set .cHn for a chain 
  398.    file and set the end address at 8000Hex. Quit to the main menu, and enter C 
  399.    to compile this program.
  400.     After  TPMESG  has been compiled,  you will have a file on your disk  named 
  401.    TPMESG.CHN. When you run TPBBS, it will chain to the message system anytime 
  402.    you enter an 'M' command.
  403.    You still aren't ready to run the BBS yet.  If you tried, the program would 
  404.    abort giving you an error message, meaning it couldn't find the USER file.
  405.  
  406.    TPINIT.PAS
  407.    You must now compile the TPINIT.PAS into a .COM file.  Put TPINIT.PAS  into 
  408.    drive <B> and set the main file name to TPINIT. At the options menu, select 
  409.    the .Com file and Quit to the main menu.  (no need to set the end address). 
  410.    Enter  C  to  compile the program,  and you will  have  the  initialization 
  411.    command file on your disk.
  412.  
  413.    Now,  put  a blank disk into drive <A> and TPINIT.COM into drive <B>.  Type 
  414.    B:TPINIT and the files;  user,  callers, counters, comments, will be opened 
  415.    on the blank disk in drive <A>.
  416.     Put  copies of TPBBS.COM and TPMESG.CHN on to the disk in drive  <A>  (with 
  417.    the newly created files) and you are ready to run.
  418.  
  419.    Suggestion: change the name that BYE searches for to TPBBS.COM in order not 
  420.    to have any conflict with RBBS.COM.  (you could change the name of TPBBS to 
  421.    RBBS,  but  then you would not know which program you really had,  and  you 
  422.    would  need to make internal changes to TPMESG.CHN;  it searches for  TPBBS 
  423.    when user aborts back the main program)
  424.  
  425.    Much  of  this program is simply converted from the RBBS.BAS  program.  The 
  426.  
  427.  
  428.                                    7
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.    various  people that have kept RBBS.BAS updated have kept it  available  to 
  438.    the public domain.  Without that,  TPBBS.PAS would probably never have been 
  439.    written.
  440.  
  441.    Thanks to the following for RBBS.BAS.
  442.    Bruce Ratoff, Howard Moulton, Ron Fowler,
  443.    Tim Nicholas, David Kozinn, and others.
  444.  
  445.  
  446.    BUGS
  447.    ----------------------------
  448.  
  449.    There are two bugs still in this system, but we have decided to go 
  450.    ahead and release the first version and fix them in the near future.
  451.    They are:
  452.  
  453.     1.  The file PASSWORD,  used to supply the SYSOP's password and such, does 
  454.    not read properly into memory.  So if you wish to change the info. you will 
  455.    have to recompile the system.
  456.  
  457.     2. Sometimes when first trying to access the system after a cold boot, the 
  458.    SYSOP will experience errors.  These may be because of my machine, and they 
  459.    never seem to last beyond 2 login attempts, so they're not fatal.
  460.  
  461.  
  462.                      Ed Curlin      -- MASTERMIND
  463.                      James Whorton  -- MINDLESS
  464.  
  465.  they're not