home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / comm / bbs / 4d-bbsdemo / docs / text / 08.menus < prev    next >
Text File  |  1993-12-28  |  29KB  |  854 lines

  1. Chapter 8:
  2.  
  3.         Menus and Menu Commands
  4.  
  5.  
  6.  
  7.  
  8.  
  9. 8.1.1  Overview
  10.  
  11. The menus are the heart of the BBS.  They direct the user around the BBS,
  12. and act as a guide.  Whether the menus are simple and plain, or complicated
  13. and fancy, the SsyOp has complete control over every aspect of the menus.
  14. This is a powerful feature enabling the SsyOp to personalize and create a
  15. BBS which is very unique.
  16.  
  17.  
  18. 8.2.1  Menu Formats
  19.  
  20. All menu files are plain ascii files located in the MENU: directory.
  21. Editing and creating menus should be done with a text editor like MEMACS,
  22. or QED.
  23.  
  24. The first line of the menu file should be the help file for the menu. This
  25. filename is appended either a .ASCII or .ANSI automatically by the BBS,
  26. depending on the on-line user's mode.
  27.  
  28. The second line is the prompt for the menu. This can include EIC codes and
  29. color codes.  If color codes are encountered and the user is in ASCII mode,
  30. they will simply be ingnored.  Max of 80 characters.
  31.  
  32. The third line is the type of entry for the menu, and they are listed
  33. below.
  34.  
  35. Type  Description
  36.  
  37.  
  38.  0    Hotkey-User Enters one character without enerting return.
  39.  
  40. #>0   User can enter UP TO # characters, and must hit return at end.
  41.       IE: 10 means the user can enter up to 10 characters.
  42.  
  43.  #    The number sign means that a user can enter one character without/
  44.       having to hit return, but can enter up to a 3 digit number and must
  45.       hit return.  This is must often used in a menu to allow the user to
  46.       enter hot keys, and full numbers (ie: in a message bases menu to
  47.       change sections.
  48.  
  49.  -1   No user entry for this menu, and the first command will be executed
  50.       automatically, irrelevant of the keypress code.  If the second, third
  51.       and so on commands also have the same keypress, they will be executed
  52.       also.  This mode is designed for Command Menus. (see 8.4.2)
  53.  
  54. From the fourth line on, each line represents one function.  Everything on
  55. the line before the : represents the keypress for that function, the : is
  56. the seperator, everything on the right side of the colon is assumed to be
  57. the command.  The command can be split up into one to four parts seperated
  58. by spaces.
  59.  
  60. If a keystroke has more characters than alotted in line three, the function
  61. WILL NOT be accessible by the user.  Multiple lines CAN HAVE the same
  62. keystroke, and all lines will be executed BUT they must ALL be consecutive
  63. lines in the menu file.
  64.  
  65. An example line would be:
  66.  
  67. p:p p 0
  68.  
  69. This means the keystroke is a single p, and the command is :p with
  70. parameters of p 0.  An example of multiple lines would be:
  71.  
  72. o:2 TEXT:LOGOFF.TXT
  73. o:0 q
  74.  
  75. This would display the file "TEXT:LOGOFF.TXT" to the user, then do a quick
  76. logoff.  The following would NOT execute the third line:
  77.  
  78. o:2 TEXT:LOGOFF.TXT
  79. o:2 TEXT:LEAVE.TXT
  80. p:p p 0
  81. o:0 q
  82.  
  83. In this example, the BBS would execute the first two commands, but upon
  84. seeing that p (line 4) is different from the o (line 2) the BBS would
  85. return to the prompt, and NOT execute the fourth line.
  86.  
  87.  
  88. 8.2.2 Layouts
  89.  
  90. 4D-BBS uses menu locks to control user access to menus.  These menu locks
  91. can be unique to each user, and are system specific.  When designing your
  92. menus, it is best to first list all menus which you will be using, and give
  93. a unique lock to each menu.  If some menus are similar in function, you can
  94. give the same lock to them, to cut down on the number of menu locks used.
  95. See Section 8.5.1 for more information.
  96.  
  97. There are two types of menu layouts which can be used. The first is a
  98. hirechy method which means a menu is called, and when finished, the calling
  99. menu regains control.  You can stack menus in this method up to 16 times,
  100. so keep this in mind when designing your menus.
  101.  
  102. The second method is a basic goto or jump.  In this method, the calling
  103. menu is NOT remembered.  This is ideal if you wish to setup a maze or
  104. setting type BBS since menus do not have to be remembered.
  105.  
  106. Below is two examples of menus:
  107.  
  108.  
  109.                           Main Menu
  110.                ________________|___________________
  111.               |                |                   |
  112.         Message Bases      File Transfers      Game Room
  113.               |
  114.       Electronic Mail
  115.  
  116.  
  117. In the above setting, a user starts out at the main menu, an can go to one
  118. of the three menus.  If they choose the message bases, they can not go into
  119. the game room unless they exit the message bases and go back to the main
  120. menu.  If they are in the file transfers, and want to go to electronic
  121. mail, they must go to the main menu, then the message bases, then finally
  122. to electronic mail.
  123.  
  124.  
  125.                       +-  Main Menu     -+
  126.                      /        |           \
  127.       Message Bases +---------+------------+-  Game Room
  128.         |            \        |           /
  129.       E-Mail          +- File Transfers -+
  130.  
  131.  
  132. In the above example, A user can jump from any section they wish to, to
  133. another section EXCEPT for the E-Mail section. To go to or from the E-Mail
  134. section, they must go through the Message Bases.
  135.  
  136. Remember the two above examples are ONLY examples, and the SYSOP can setup
  137. the BBS using one of them, a combination, or design their own layout.
  138.  
  139.  
  140. 8.2.3  Menu Move Commands
  141.  
  142. The 0 and 1 menu command cover most basic menu move operations. They are:
  143.  
  144. Command    Description
  145.  
  146. 0 e        Exits the current menu, and returs to the calling menu.  Can
  147.            Only be used if the calling menu used the 1 command.
  148.  
  149. 0 M        Returns to the main menu and clears all hierachy stacks.
  150.  
  151. 0 * NAME   Enters a new menu WITHOUT saving the previous menu.  The * is
  152.            the lock for the new menu.  The new menu does NOT know who the
  153.            calling menu was.
  154.  
  155.  
  156. 1 * Name   Enter a name menu saving the previous menu.  The * is the lock
  157.            for the new menu.  The new menu DOES know who the calling menu
  158.            is and can use the 0 e command to return to the calling menu.
  159.  
  160.  
  161. The two basic commands for moving between menus can be mixed (as in the
  162. second example of section 8.2.2, but caution should be exercised when doing
  163. so.  A loop like this can cause stack limit problems:
  164.  
  165.          Menu --+
  166.           |     |
  167.       Sub-Menu  |
  168.           |     |
  169.      Sub-Menu2 -+
  170.  
  171. If a jump was used to go from sub-menu 2 back to menu, the stack would not
  172. be cleared.  Doing this two many times would bring upon a maximum sub-menus
  173. encountered error to the user.
  174.  
  175. 8.3.1  Menu Commands
  176.  
  177. When a user hits a key in a menu, the BBS will scan the menu file, to see
  178. if any matching keypresses are found.  If none are found, and the menu is
  179. in kotkey mode, nothing will happen, and the BBS will get another
  180. character.  If the menu is multi-character input and the BBS does not find
  181. a match, it will display "Unknown menu function" and redisplay the prompt.
  182.  
  183. If the BBS does find a match, it will execute the command after the : in
  184. the line, and then check to see if the next line is the same. If it is,
  185. then that line will also be executed, and this cycle is continued until
  186. either a match is not found, or the last command is executed.
  187.  
  188. Once a command is finished the BBS displays the prompt again, and starts
  189. this process all over again.  If the command which was executed goes to
  190. another menu, this process is continued on THAT menu.  If the command logs
  191. the user off, the process of course, stops.
  192.  
  193.  
  194. 8.4.1  Types of Menu
  195.  
  196. Currently there are four types of menus which you can setup. These four
  197. types of menus are command menus, personal menus, access menus, and
  198. default menus.
  199.  
  200. 8.4.2  Command Menus
  201.  
  202. A command menu is a menu that directly executes the first command without
  203. displaying the logon/stats screen, or bulletins.  An example of using
  204. this type of menu would be if you wanted to spawn a serial based program
  205. when a certain account logged on.  UUCP's UUCICO could be used this way.
  206.  
  207. The format for this type of menu is the "Cmd." plus the account name
  208. plus ".menu". So, if you were running UUCP, and your feeds logon account
  209. was called UUCP, you would make a menu called Cmd.UUCP.Menu, which is a
  210. normal menu, with the first command as "a:4 UUCICO" and the second command
  211. as "a:q".  Although the keypress for the commands are irelavant, they MUST
  212. be the same.
  213.  
  214. 8.4.3  Personal Menus
  215.  
  216. A personal menu is the same as a