home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / MODS / MORGUL20.ZIP / MORGUL20.MOD < prev   
Encoding:
Text File  |  1995-06-13  |  8.3 KB  |  273 lines

  1. Morgul #1 @6100
  2. 1Thursday, 2June 38, 51995 7@ 1106:155 7pm
  3. ┌────────────────────────────────────────────────────────────────────────────┐
  4. │ Mod Name:MORGUL20.424      Mod Authors: Morgul                             │
  5. │                             Original mod by The Flying Chicken             │
  6. │ Difficulty: Block Copy            Date: June 8, 1995                       │
  7. │ WWIV Version: 4.24                                                         │
  8. │ Files Affected: BBSOVL1.C                                                  │
  9. │ Description: Cool sublist mod for 4.24!                                    │
  10. │                                                                            │
  11. └────────────────────────────────────────────────────────────────────────────┘
  12.  
  13.     Ok, this mod was originally known as TFC004, and was (IMHO) one of the best
  14. sublisting mods around.  Well, thanks to the changes in 4.23, I ended up having
  15. to re-write the mod almost from scratch.  Then Wayne changed stuff AGAIN in
  16. 4.24, so I had to make some minor changes. <sigh>
  17. Because of the extensive changes in the mod. I released it under my name becaus
  18. e
  19. it involved a fair amount of changes...however, the original credit goes to The
  20. Flying Chicken for his excellent mod.
  21.     This mod assumes you have ENHANCE.C installed, as it calls one or two
  22. functions from it.  If you don't, I've included the functions at the end of the
  23. mod.
  24.  
  25. << Step 1 >>
  26.     Back up your source
  27.  
  28. << Step 2 >>
  29.     Load up BBSOVL1.C.  Go down to void sublist, and delete it completely.
  30.  
  31. << Step 3 >>
  32.     Block copy this function in to replace it.
  33.  
  34. void sublist(void)
  35. {
  36.   int i,i1,abort,oc,os,sn,en, i4, sam, tally, tt, altnetnum,sam2;
  37.   char s[80],s1[80],*ss,ch,s2[10], s3[80], s4[80], s5[80], sdf[130];
  38.     postrec *p3;
  39.  
  40.   oc=curconfsub; os=usub[cursub].subnum;
  41.  
  42.   abort=0;
  43.   sn=0;
  44.   en=subconfnum-1;
  45.   if (okconf(&thisuser)) {
  46.     if (uconfsub[1].confnum!=-1) {
  47.       nl();
  48.       prt(2,get_string(1019));
  49.       ch=onek("Q A");
  50.       nl();
  51.       switch (ch) {
  52.         case ' ':
  53.           sn=curconfsub;
  54.           en=curconfsub;
  55.           break;
  56.         case 'Q':
  57.           return;
  58.       }
  59.     }
  60.   } else
  61.     oc=-1;
  62.  
  63.     outchr(12);
  64.     nl();
  65.     sprintf(s,"4%s's Message Bases0",syscfg.systemname);
  66.  
  67.     ansic(7);
  68.  
  69.     for (i4=0;i4<78;i4++)
  70.         if (okansi())
  71.             outchr(196);
  72.         else
  73.             outchr(45);
  74.   nl();
  75.   i=sn;
  76.   while ((i<=en) && (uconfsub[i].confnum!=-1) && (!abort)) {
  77.     if ((uconfsub[1].confnum!=-1) && (okconf(&thisuser))) {
  78.       setuconf(CONF_SUBS, i, -1);
  79.       sprintf(s,"7[2%s 1%c7] 6: 7[2 %s 7]",get_string(1021),0
  80.         subconfs[uconfsub[i].confnum].designator,
  81.         stripcolors(subconfs[uconfsub[i].confnum].name));
  82. center(1,s);
  83. nl();
  84.     ansic(7);
  85.  
  86.     for (i4=0;i4<78;i4++)
  87.         if (okansi())
  88.             outchr(196);
  89.         else
  90.             outchr(45);
  91.     }
  92.     nl();
  93.     i1=0;
  94.  
  95.     prt(2,"Sub          Networked/                                             
  96. Old  New");
  97.     nl();
  98.     prt(2," #    Scn?      Local       Sub Name                                
  99. Messages");
  100. nl();
  101. ansic(7);
  102.     for (i4=0;i4<78;i4++)
  103.         if (okansi())
  104.             outchr(196);
  105.         else
  106.             outchr(45);
  107.   nl();
  108.  
  109.     while ((i1<num_subs) && (usub[i1].subnum!=-1) && (!abort)) {
  110.       sprintf(s,"    %-3.3s",usub[i1].keys);
  111.       if (qsc_q[usub[i1].subnum/32]&(1L<<(usub[i1].subnum%32)))
  112.         strcpy(s2," 6* ");0
  113.       else
  114.         strcpy(s2," 2- ");0
  115.       iscan(i1);
  116.       if (net_sysnum || (net_num_max>1)) {
  117.         if (xsubs[usub[i1].subnum].num_nets) {
  118.           if (xsubs[usub[i1].subnum].num_nets>1)
  119.             ss=get_string(1022);
  120.           else
  121.             ss=stripcolors(net_networks[xsubs[usub[i1].subnum].nets[0].net_num]
  122. .name);
  123.           altnetnum=net_num+1;
  124.           if (altnetnum>=10)
  125.             altnetnum-=10;
  126.           if (subboards[usub[i1].subnum].anony & anony_val_net)
  127.           sprintf(s3,"2[%i%-8.8s2]",altnetnum,ss);0
  128.             else
  129.           sprintf(s3,"2<%i%-8.8s2>",altnetnum,ss);0
  130.         } else
  131.         strcpy(s3," 2>5LOCAL2<  ");0
  132.  
  133.       }
  134.         sam=1;
  135.         sam2=1;
  136.         while (sam2<=nummsgs)
  137.         {
  138.             p3=get_post(sam2);
  139.             if (p3->qscan>qsc_p[usub[i1].subnum])
  140.             ++sam;
  141.             ++sam2;
  142.         }
  143.         sam=sam-1;
  144.         tally=sam;
  145. if (okansi()) {
  146.     if(tally) {
  147.       if (oc==curconfsub) {
  148.         if (usub[cursub].subnum==usub[i1].subnum)
  149.           sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 4%-40.40s 7│ 2%3d 7│ 6%d 7",i1+1,s2,s3,s0
  150. ubboards[usub[i1].subnum].name,nummsgs,tally);
  151.         else
  152.           sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 6%d 7",i1+1,s2,s3,s0
  153. ubboards[usub[i1].subnum].name, nummsgs, tally);
  154.       } else
  155.         sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 6%d 7",i1+1,s2,s3,sub0
  156. boards[usub[i1].subnum].name, nummsgs, tally);
  157.     } else {
  158.         if (oc==curconfsub) {
  159.          if (usub[cursub].subnum==usub[i1].subnum)
  160.               sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 4%-40.40s 7│ 2%3d 7│ 3%d 7",i1+1,s2,0
  161. s3,subboards[usub[i1].subnum].name, nummsgs, tally);
  162.              else
  163.               sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 3%d 7",i1+1,s2,0
  164. s3,subboards[usub[i1].subnum].name,nummsgs, tally);
  165.          } else
  166.                 sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 3%d 7",i1+1,s0
  167. 2,s3,subboards[usub[i1].subnum].name, nummsgs, tally);
  168.     } } else {
  169.             if (tally) {
  170.         if (usub[cursub].subnum==usub[i1].subnum)
  171.                sprintf(sdf," 2%2s 7| %3s | %6s | 4%-40.40s 7| 2%3d 7│ 6%d 7",s,s2,s3,su0
  172. bboards[usub[i1].subnum].name, nummsgs, tally);
  173.             else
  174.                sprintf(sdf," 2%2s 7| %3s | 3%6s 7| 1%-40.40s 7| 2%3d 7│  6%d 7",s,s2,s3,s0
  175. ubboards[usub[i1].subnum].name,nummsgs, tally);
  176.             } else {
  177.         if (usub[cursub].subnum==usub[i1].subnum)
  178.                sprintf(sdf," 2%2s 7| %3s | %6s | 4%-40.40s 7| 2%3d 7│ 6%d 7",s,s2,s3,su0
  179. bboards[usub[i1].subnum].name, nummsgs, tally);
  180.             else
  181.                sprintf(sdf," 2%2s 7| %3s | 3%6s 7| 1%-40.40s 7| 2%3d 7│ 3%d 7",s,s2,s3,su0
  182. bboards[usub[i1].subnum].name, nummsgs, tally);
  183.            }
  184.        }
  185.  
  186.  
  187.       pla(sdf,&abort);
  188.       i1++;
  189.     }
  190.     i++;
  191.     nl();
  192.     ansic(7);
  193.  
  194.     for (i4=0;i4<78;i4++)
  195.         if (okansi())
  196.             outchr(196);
  197.         else
  198.             outchr(45);
  199.             nl();
  200.  
  201.     if (!okconf(&thisuser))
  202.       break;
  203.   }
  204.   if (i==0) {
  205.     pla(get_string(5),&abort);
  206.     nl();
  207.   }
  208.  
  209.   setuconf(CONF_SUBS, oc, os);
  210. }
  211. /****************************************************************************/
  212.  
  213. << Step 4 >>
  214.     Save and recompile.  This gives a nice looking sublisting.  If you've got
  215.     conferencing enabled, it seperates the subs by conference as well.  It
  216.     shows the total number of messages, as well as the total number of NEW,
  217.     unread messages, and highlights the current sub with a blue bar.
  218.  
  219.     Now, if you don't have Tolkien's ENHANCE.C installed (and for the life of
  220.     me, I can't figure out why not), then you'll need this function.  Find a
  221.     place to put it, and put it there.  Don't forget to list it in FCNS.H!
  222.  
  223. void center(int a, unsigned char *s)
  224. /*
  225.  * This function centers a string on a line, and takes into account the
  226.  * embedded WWIV color codes (ASCII 003's).
  227.  *
  228.  */
  229. {
  230.   char s1[160];
  231.   int i,x,col,lenx;
  232.   div_t len;
  233.  
  234.   i = 0;
  235.   x = 0;
  236.   lenx = strlen(s);
  237.  
  238.   while (s[x]) {
  239.     if (s[x]==3) {
  240.       lenx--;
  241.       lenx--;
  242.     }
  243.     x++;
  244.   }
  245.   if (thisuser.screenchars > lenx) {
  246.     col = thisuser.screenchars - lenx;
  247.     len = div(col,2);
  248.     i = len.quot;
  249.   }
  250.   strcpy(s1,"");
  251.   while (i>0) {
  252.     strcat(s1," ");
  253.     i--;
  254.   }
  255.   strcat(s1,s);
  256.   ansic(a);
  257.   outstr(s1);
  258. }
  259. /*
  260.  * Example:
  261.  *
  262.  * center(6,"Hey Jude, don't make it bad.");
  263.  *
  264.  */
  265.  
  266. /*═════════════════════════════════════════════════════════════════════════*/
  267.  
  268. << Step 5 >>
  269.     If you use this mod, drop me a line and let me know.  In addition, drop TFC
  270.     a line (1@2456 WWIVNet/Icenet) and let him know how much you like his
  271.     original mod.
  272.  
  273.