home *** CD-ROM | disk | FTP | other *** search
- Morgul #1 @6100
- 1Thursday, 2June 38, 51995 7@ 1106:155 7pm
- ┌────────────────────────────────────────────────────────────────────────────┐
- │ Mod Name:MORGUL20.424 Mod Authors: Morgul │
- │ Original mod by The Flying Chicken │
- │ Difficulty: Block Copy Date: June 8, 1995 │
- │ WWIV Version: 4.24 │
- │ Files Affected: BBSOVL1.C │
- │ Description: Cool sublist mod for 4.24! │
- │ │
- └────────────────────────────────────────────────────────────────────────────┘
-
- Ok, this mod was originally known as TFC004, and was (IMHO) one of the best
- sublisting mods around. Well, thanks to the changes in 4.23, I ended up having
- to re-write the mod almost from scratch. Then Wayne changed stuff AGAIN in
- 4.24, so I had to make some minor changes. <sigh>
- Because of the extensive changes in the mod. I released it under my name becaus
- e
- it involved a fair amount of changes...however, the original credit goes to The
- Flying Chicken for his excellent mod.
- This mod assumes you have ENHANCE.C installed, as it calls one or two
- functions from it. If you don't, I've included the functions at the end of the
- mod.
-
- << Step 1 >>
- Back up your source
-
- << Step 2 >>
- Load up BBSOVL1.C. Go down to void sublist, and delete it completely.
-
- << Step 3 >>
- Block copy this function in to replace it.
-
- void sublist(void)
- {
- int i,i1,abort,oc,os,sn,en, i4, sam, tally, tt, altnetnum,sam2;
- char s[80],s1[80],*ss,ch,s2[10], s3[80], s4[80], s5[80], sdf[130];
- postrec *p3;
-
- oc=curconfsub; os=usub[cursub].subnum;
-
- abort=0;
- sn=0;
- en=subconfnum-1;
- if (okconf(&thisuser)) {
- if (uconfsub[1].confnum!=-1) {
- nl();
- prt(2,get_string(1019));
- ch=onek("Q A");
- nl();
- switch (ch) {
- case ' ':
- sn=curconfsub;
- en=curconfsub;
- break;
- case 'Q':
- return;
- }
- }
- } else
- oc=-1;
-
- outchr(12);
- nl();
- sprintf(s,"4%s's Message Bases0",syscfg.systemname);
-
- ansic(7);
-
- for (i4=0;i4<78;i4++)
- if (okansi())
- outchr(196);
- else
- outchr(45);
- nl();
- i=sn;
- while ((i<=en) && (uconfsub[i].confnum!=-1) && (!abort)) {
- if ((uconfsub[1].confnum!=-1) && (okconf(&thisuser))) {
- setuconf(CONF_SUBS, i, -1);
- sprintf(s,"7[2%s 1%c7] 6: 7[2 %s 7]",get_string(1021),0
- subconfs[uconfsub[i].confnum].designator,
- stripcolors(subconfs[uconfsub[i].confnum].name));
- center(1,s);
- nl();
- ansic(7);
-
- for (i4=0;i4<78;i4++)
- if (okansi())
- outchr(196);
- else
- outchr(45);
- }
- nl();
- i1=0;
-
- prt(2,"Sub Networked/
- Old New");
- nl();
- prt(2," # Scn? Local Sub Name
- Messages");
- nl();
- ansic(7);
- for (i4=0;i4<78;i4++)
- if (okansi())
- outchr(196);
- else
- outchr(45);
- nl();
-
- while ((i1<num_subs) && (usub[i1].subnum!=-1) && (!abort)) {
- sprintf(s," %-3.3s",usub[i1].keys);
- if (qsc_q[usub[i1].subnum/32]&(1L<<(usub[i1].subnum%32)))
- strcpy(s2," 6* ");0
- else
- strcpy(s2," 2- ");0
- iscan(i1);
- if (net_sysnum || (net_num_max>1)) {
- if (xsubs[usub[i1].subnum].num_nets) {
- if (xsubs[usub[i1].subnum].num_nets>1)
- ss=get_string(1022);
- else
- ss=stripcolors(net_networks[xsubs[usub[i1].subnum].nets[0].net_num]
- .name);
- altnetnum=net_num+1;
- if (altnetnum>=10)
- altnetnum-=10;
- if (subboards[usub[i1].subnum].anony & anony_val_net)
- sprintf(s3,"2[%i%-8.8s2]",altnetnum,ss);0
- else
- sprintf(s3,"2<%i%-8.8s2>",altnetnum,ss);0
- } else
- strcpy(s3," 2>5LOCAL2< ");0
-
- }
- sam=1;
- sam2=1;
- while (sam2<=nummsgs)
- {
- p3=get_post(sam2);
- if (p3->qscan>qsc_p[usub[i1].subnum])
- ++sam;
- ++sam2;
- }
- sam=sam-1;
- tally=sam;
- if (okansi()) {
- if(tally) {
- if (oc==curconfsub) {
- if (usub[cursub].subnum==usub[i1].subnum)
- sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 4%-40.40s 7│ 2%3d 7│ 6%d 7",i1+1,s2,s3,s0
- ubboards[usub[i1].subnum].name,nummsgs,tally);
- else
- sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 6%d 7",i1+1,s2,s3,s0
- ubboards[usub[i1].subnum].name, nummsgs, tally);
- } else
- sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 6%d 7",i1+1,s2,s3,sub0
- boards[usub[i1].subnum].name, nummsgs, tally);
- } else {
- if (oc==curconfsub) {
- if (usub[cursub].subnum==usub[i1].subnum)
- sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 4%-40.40s 7│ 2%3d 7│ 3%d 7",i1+1,s2,0
- s3,subboards[usub[i1].subnum].name, nummsgs, tally);
- else
- sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 3%d 7",i1+1,s2,0
- s3,subboards[usub[i1].subnum].name,nummsgs, tally);
- } else
- sprintf(sdf," 2%-3.3d 7│ %3s │ %6s │ 1%-40.40s 7│ 2%3d 7│ 3%d 7",i1+1,s0
- 2,s3,subboards[usub[i1].subnum].name, nummsgs, tally);
- } } else {
- if (tally) {
- if (usub[cursub].subnum==usub[i1].subnum)
- sprintf(sdf," 2%2s 7| %3s | %6s | 4%-40.40s 7| 2%3d 7│ 6%d 7",s,s2,s3,su0
- bboards[usub[i1].subnum].name, nummsgs, tally);
- else
- sprintf(sdf," 2%2s 7| %3s | 3%6s 7| 1%-40.40s 7| 2%3d 7│ 6%d 7",s,s2,s3,s0
- ubboards[usub[i1].subnum].name,nummsgs, tally);
- } else {
- if (usub[cursub].subnum==usub[i1].subnum)
- sprintf(sdf," 2%2s 7| %3s | %6s | 4%-40.40s 7| 2%3d 7│ 6%d 7",s,s2,s3,su0
- bboards[usub[i1].subnum].name, nummsgs, tally);
- else
- sprintf(sdf," 2%2s 7| %3s | 3%6s 7| 1%-40.40s 7| 2%3d 7│ 3%d 7",s,s2,s3,su0
- bboards[usub[i1].subnum].name, nummsgs, tally);
- }
- }
-
-
- pla(sdf,&abort);
- i1++;
- }
- i++;
- nl();
- ansic(7);
-
- for (i4=0;i4<78;i4++)
- if (okansi())
- outchr(196);
- else
- outchr(45);
- nl();
-
- if (!okconf(&thisuser))
- break;
- }
- if (i==0) {
- pla(get_string(5),&abort);
- nl();
- }
-
- setuconf(CONF_SUBS, oc, os);
- }
- /****************************************************************************/
-
- << Step 4 >>
- Save and recompile. This gives a nice looking sublisting. If you've got
- conferencing enabled, it seperates the subs by conference as well. It
- shows the total number of messages, as well as the total number of NEW,
- unread messages, and highlights the current sub with a blue bar.
-
- Now, if you don't have Tolkien's ENHANCE.C installed (and for the life of
- me, I can't figure out why not), then you'll need this function. Find a
- place to put it, and put it there. Don't forget to list it in FCNS.H!
-
- void center(int a, unsigned char *s)
- /*
- * This function centers a string on a line, and takes into account the
- * embedded WWIV color codes (ASCII 003's).
- *
- */
- {
- char s1[160];
- int i,x,col,lenx;
- div_t len;
-
- i = 0;
- x = 0;
- lenx = strlen(s);
-
- while (s[x]) {
- if (s[x]==3) {
- lenx--;
- lenx--;
- }
- x++;
- }
- if (thisuser.screenchars > lenx) {
- col = thisuser.screenchars - lenx;
- len = div(col,2);
- i = len.quot;
- }
- strcpy(s1,"");
- while (i>0) {
- strcat(s1," ");
- i--;
- }
- strcat(s1,s);
- ansic(a);
- outstr(s1);
- }
- /*
- * Example:
- *
- * center(6,"Hey Jude, don't make it bad.");
- *
- */
-
- /*═════════════════════════════════════════════════════════════════════════*/
-
- << Step 5 >>
- If you use this mod, drop me a line and let me know. In addition, drop TFC
- a line (1@2456 WWIVNet/Icenet) and let him know how much you like his
- original mod.
-
-