home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / MODS / ALLMODS.ZIP / FR040_B.MOD < prev    next >
Encoding:
Text File  |  1995-06-13  |  10.6 KB  |  359 lines

  1. ┌───────────────────────────────────────────────────────────────────────────┐
  2. │ Mod Name: FR040.MOD         Mod Author: Frank Reid WWIVnet @8213          │
  3. │ Difficulty: Beginner              Date: June 3, 1995                      │
  4. │ WWIV Version: 4.24                                                        │
  5. │ Description: A two-up subboard listing which allows you to change to a    │
  6. │ new conference or select a subboard by number when done displaying.       │
  7. └───────────────────────────────────────────────────────────────────────────┘
  8.  
  9. 1.  Back up your source!  I take NO responsibility for ill effects of this or
  10. any of my mods.  I'd be happy to help you get it working, though.
  11.  
  12. 2.  Description:  Companion to my two-column directory list (FR007E), this
  13. displays the subboards in a two-column, top-to-bottom list, and prompts the
  14. user for a sub number or conference change when done.
  15.  
  16. 3.  Credits:  Same as FR007 -- mostly Morgul! :-)
  17.  
  18. 4.  Drawback:  The mod provides non-ANSI support, however no support for 40
  19. columns.  If your users still use 40 column mode(!), you'll have to use the
  20. old sublist, too -- drop me a note if you need help there.
  21.  
  22. 5.  Mechanics:  The mod itself is mainly a single block copy, but we have to
  23. give sublist a new prototype with a 'mode' parameter.  (Mode '0' does not
  24. prompt for a subboard number, which is needed for moving/extracting messages.)
  25.  
  26. Open <BBSOVL1.C>
  27.  
  28. At the top of the file, add these two new stock includes.  (For the curious,
  29. math.h includes the prototype for "ceiling" which determines the top limit of
  30. the number of directories, and ctype.h has prototypes for determining whether
  31. keyboard input is numeric, alphabetic, etc.)
  32.  
  33. **** These should already be there if you have FR007E installed! ****
  34.  
  35. == #include "ripint.h"
  36.  
  37. ++ #include <math.h>
  38. ++ #include <ctype.h>
  39.  
  40. == #define FRAME 7
  41.  
  42. Search for "void sublist(void)" and delete the entire function.  Replace
  43. it with this:
  44.  
  45. void sublist(int mode)
  46. {
  47.   int i, i1, i2, i3, i4, oc, nc, os, done, next, abort, ns, ns1, sn, en, tt;
  48.   int c1, c2, c3, c4;
  49.   char *num, ch, s[100], s1[100], s2[100], s3[100], s4[40];
  50.   double nsd;
  51.  
  52.   sn = 0;
  53.   i4 = 0;
  54.   next = 0;
  55.   oc = nc = curconfsub;
  56.   os = udir[cursub].subnum;
  57.   en = subconfnum - 1;
  58.  
  59.   do {
  60.     abort = 0;
  61.     done = 0;
  62.     if (!i4) {
  63.       if (okconf(&thisuser)) {
  64.         if ((uconfsub[1].confnum != -1) && (!next)) {
  65.           nl();
  66.           prt(2, get_string(1019));
  67.           ch = onek("Q A");
  68.           nl();
  69.           switch (ch) {
  70.           case ' ':
  71.             sn = curconfsub;
  72.             en = curconfsub;
  73.             break;
  74.           case 'A':
  75.             mode = 0;
  76.             break;
  77.           case 'Q':
  78.             return;
  79.           }
  80.         }
  81.       } else
  82.         oc = -1;
  83.     } else {
  84.       sn = curconfsub;
  85.       en = curconfsub;
  86.     }
  87.     next = 1;
  88.     i = sn;
  89.     outchr(12);
  90.     nl();
  91.     while ((i <= en) && (uconfsub[i].confnum != -1) && (!abort)) {
  92.       if ((uconfsub[1].confnum != -1) && (okconf(&thisuser))) {
  93.         setuconf(CONF_SUBS, i, -1);
  94.         sprintf(s, "[ %s %c - %s ]", get_string(1021),
  95.            subconfs[uconfsub[i].confnum].designator,
  96.           stripcolors(subconfs[uconfsub[i].confnum].name));
  97.         if (okansi()) {
  98.           tt = (40 - (strlen(s) / 2));
  99.           npr("\x1B" "[0;1m%s\r\n", charstr(strlen(s) + (tt * 2 - 2), '▄'));
  100.           npr("\x1B" "[0;34;47m%s", charstr(tt, ' '));
  101.           npr("\x1B" "[0;34;47m%s", s);
  102.           npr("\x1B" "[0;34;47m%s\x1B" "[40m\r\n", charstr(tt - 2, ' '));
  103.           npr("\x1B" "[0;1;30m%s\r\n", charstr(strlen(s) + (tt * 2 - 2), '▀'));
  104.         } else {
  105.           for (i2 = 0; i2 < 78; i2++)
  106.             outchr(45);
  107.           nl();
  108.           prt(1, s);
  109.           nl();
  110.           for (i2 = 0; i2 < 78; i2++)
  111.             outchr(45);
  112.           nl();
  113.         }
  114.       } else {
  115.         sprintf(s, "[ %s Message Areas ]", syscfg.systemname);
  116.         if (okansi()) {
  117.           tt = (40 - (strlen(s) / 2));
  118.           npr("\x1B" "[0;1m%s\r\n", charstr(strlen(s) + (tt * 2 - 2), '▄'));
  119.           npr("\x1B" "[0;34;47m%s", charstr(tt, ' '));
  120.           npr("\x1B" "[0;34;47m%s", s);
  121.           npr("\x1B" "[0;34;47m%s\x1B" "[40m\r\n", charstr(tt - 2, ' '));
  122.           npr("\x1B" "[0;1;30m%s\r\n", charstr(strlen(s) + (tt * 2 - 2), '▀'));
  123.         } else {
  124.           for (i2 = 0; i2 < 78; i2++)
  125.             outchr(45);
  126.           nl();
  127.           prt(1, s);
  128.           nl();
  129.           for (i2 = 0; i2 < 78; i2++)
  130.             outchr(45);
  131.           nl();
  132.         }
  133.       }
  134.       c1 = thisuser.colors[8];
  135.       thisuser.colors[8] = 1;
  136.       ansic(8);
  137.       if (okansi())
  138.         outchr(213);
  139.       else
  140.         outchr(43);
  141.       for (i2 = 1; i2 < 77; i2++)
  142.         if (okansi())
  143.           outchr(205);
  144.         else
  145.           outchr(45);
  146.       if (okansi())
  147.         outchr(184);
  148.       else
  149.         outchr(43);
  150.       nl();
  151.       thisuser.colors[8] = c1;
  152.       i1 = 0;
  153.       ns = 0;
  154.       while ((i1 <= num_subs) && (ns == 0)) {
  155.         if ((usub[i1].subnum == -1) || (i1 == num_subs))
  156.           ns = i1;
  157.         else
  158.           i1++;
  159.       }
  160.       ns1 = ns;
  161.       nsd = ceil(((double) ns) / 2);
  162.       ns = (int) nsd;
  163.       i3 = 0;
  164.       for (i1 = 0; ((i1 < ns) && (!abort) && (!hangup)); i1++) {
  165.           if (atoi(usub[i1].keys) == 0)
  166.             i3 = 1;
  167.           strcpy(s4,subboards[usub[i1].subnum].name);
  168.           if (okansi()) {
  169.             if ((nc == oc) || (!okconf(&thisuser))) {
  170.               if (usub[i1].subnum == os) {
  171.                 sprintf(s3, "%-30.30s", s4);
  172.                 sprintf(s1, "8│ 0▐6%3s2▌4 %-30s",
  173.                   usub[i1].keys,
  174.                   s3);
  175.               } else {
  176.                 sprintf(s3, "%-30.30s", s4);
  177.                 sprintf(s1, "8│ 0▐6%3s2▌ 1%-30s",
  178.                   usub[i1].keys,
  179.                   s3);
  180.               }
  181.             } else {
  182.               sprintf(s3, "%-30.30s", s4);
  183.               sprintf(s1, "8│ 0▐6%3s2▌ 1%-30s",
  184.                 usub[i1].keys,
  185.                 s3);
  186.             }
  187.           } else {
  188.             sprintf(s3, "%-30.30s", s4);
  189.             sprintf(s1, " %3s | %-30s", usub[i1].keys,
  190.               s3);
  191.           }
  192.           if ((usub[i1 + ns].subnum != -1)) {
  193.             strcpy(s4,subboards[usub[i1+ns].subnum].name);
  194.             if (okansi()) {
  195.               if (usub[i1 + ns].subnum == os) {
  196.                 sprintf(s3, "%-30.30s", s4);
  197.                 sprintf(s2, " 0▐6%3s2▌4 %-30s 8│",
  198.                   usub[i1 + ns].keys,
  199.                   s3);
  200.               } else {
  201.                 sprintf(s3, "%-30.30s", s4);
  202.                 sprintf(s2, " 0▐6%3s2▌ 1%-30s 8│",
  203.                   usub[i1 + ns].keys,
  204.                   s3);
  205.               }
  206.             } else {
  207.               sprintf(s3, "%-30.30s", s4);
  208.               sprintf(s2, "| %3s | %-30s",
  209.                 usub[i1 + ns].keys,
  210.                 s3, numf);
  211.             }
  212.             sprintf(s, "%35s %-35s", s1, s2);
  213.           } else {
  214.             if (okansi())
  215.               sprintf(s, "%-35s %s8│", s1, charstr(38, 32));
  216.             else
  217.               sprintf(s, "%-35s |     |", s1);
  218.           }
  219.           c1 = thisuser.colors[8];
  220.           c2 = thisuser.colors[6];
  221.           c3 = thisuser.colors[2];
  222.           c4 = thisuser.colors[0];
  223.           thisuser.colors[8] = 1;
  224.           thisuser.colors[2] = 8;
  225.           thisuser.colors[6] = 112;
  226.           thisuser.colors[0] = 15;
  227.           pla(s, &abort);
  228.           thisuser.colors[8] = c1;
  229.           thisuser.colors[6] = c2;
  230.           thisuser.colors[2] = c3;
  231.           thisuser.colors[0] = c4;
  232.       }
  233.       i++;
  234.       c1 = thisuser.colors[8];
  235.       thisuser.colors[8] = 1;
  236.       ansic(8);
  237.       if (okansi())
  238.         outchr(212);
  239.       else
  240.         outchr(43);
  241.       for (i2 = 1; i2 < 77; i2++)
  242.         if (okansi())
  243.           outchr(205);
  244.         else
  245.           outchr(45);
  246.       if (okansi())
  247.         outchr(190);
  248.       else
  249.         outchr(43);
  250.       nl();
  251.       thisuser.colors[8] = c1;
  252.       if (!okconf(&thisuser))
  253.         break;
  254.     }
  255.     if (i == 0) {
  256.       pla(get_string(5), &abort);
  257.       nl();
  258.     }
  259.     if ((!abort) && (mode == 1)) {
  260.       prt(2, "Select [");
  261.       sprintf(s, "%s-%d", i3 ? "0" : "1", i3 ? (ns1-1) : ns1);
  262.       ansic(1);
  263.       outstr(s);
  264.       i3 = 0;
  265.       if (okconf(&thisuser))
  266.         outstr(",J");
  267.       outstr(",?,Q2]: ");
  268.       num = mmkey(0);
  269.       if ((strcmp(num, "") == 0) || (strcmp(num, "Q") == 0)) {
  270.         if (okconf(&thisuser))
  271.           setuconf(CONF_SUBS, nc, 1);
  272.         done = 1;
  273.       }
  274.       if (((strcmp(num, "C") == 0) || ((strcmp(num, "J") == 0))) &&
  275.           (okconf(&thisuser))) {
  276.         i4 = 1;
  277.         jump_conf(CONF_SUBS);
  278.         nc = curconfsub;
  279.         done = 0;
  280.       }
  281.       if (isdigit(num[0])) {
  282.         for (i2 = 0; i2 < num_subs; i2++) {
  283.           if (strcmp(usub[i2].keys, num) == 0) {
  284.             cursub = i2;
  285.             os = usub[cursub].subnum;
  286.             done = 1;
  287.           }
  288.         }
  289.       }
  290.     } else {
  291.       if (okconf(&thisuser))
  292.         setuconf(CONF_SUBS, oc, os);
  293.       done = 1;
  294.     }
  295.   } while ((!hangup) && (!done));
  296.   nl();
  297. }
  298.  
  299. Save <BBSOVL1.C>
  300.  
  301. Load <MMENU.C>
  302.  
  303. In "void mainmenu(void)" search for "sublist" and change:
  304.  
  305. ==      case '*':
  306. ==#ifdef RIPDRIVE
  307. ==        rd_coff();
  308. ==#endif
  309. =+        sublist(1);
  310. ==#ifdef RIPDRIVE
  311. ==        rd_con();
  312. ==#endif
  313. ==        break;
  314.  
  315. Save <MMENU.C>
  316.  
  317. Load <MSGBASE1.C>
  318.  
  319. Search again for "sublist" and change:
  320.  
  321. ==                    prt(2,get_string(686));
  322. ==                    ss1=mmkey(0);
  323. ==                    if (ss1[0]=='?') {
  324. =+                      sublist(0);
  325. ==                    }
  326.  
  327. Save <MSGBASE1.C>
  328.  
  329. Open <QWK1.C>
  330.  
  331. Again, search for "sublist" and change the line:
  332.  
  333. ==        else if(substr[0] == '?')
  334. =+          sublist(0);
  335. ==        else
  336. ==          done5=1;
  337.  
  338. Save <QWK1.C>
  339.  
  340. Load <FCNS.H>
  341.  
  342. This step is unnecessary if you use 'MAKE FCNS'.
  343.  
  344. Search for "dirlist" again, and change:
  345.  
  346. =+void sublist(int mode);
  347. ==void dirlist(void);
  348. ==void text_edit(void);
  349.  
  350. Save <FCNS.H>
  351.  
  352. Recompile and drop me a note to say you like it (or hate it!)
  353.  
  354. 4───────────────────────────────────────────────────────────────────────────────0
  355. 4  Eagle's Dare             WWIV Core Support Site               WWIVnet @8213  0
  356. 4  FILEnet @1160                  Laurel, MD                    TerraNet @3104  0
  357. 4  IceNET @3104                 (301) 498-1984               Fidonet 1:109/568  0
  358. 4───────────────────────────────────────────────────────────────────────────────0
  359.