2TFC005.MOD 1Enhanced Time Display Mod The Flying Chicken [SysOp] #1 @12456 3Sunday, March 7, 1993 1 7:52 pm TFC005.MOD - Enhanced time display Author: The Flying Chicken 1@12456 (WWIVLink) 1@2456 (WWIVNet) 1@2456 (IceNet) Source: WWIV 4.20 thru 4.22 Version: 1.6 After staring at the "01:50:30" time display for ages, I got real tired of it, and decided it would be easy to make it more meaningful. Well, that's exactly what this mod does. Many users don't understand what "01:50:30" means, but they do understand "1 hour, 50 minutes, 30 seconds". I also have included Goose's enhanced time display mod, mainly becuase it is a mod that should be included in the source code anyway. That mod changes "Sun, Apr 1 14:28:12 1990" to the more readable format, "Sunday, April 1, 1990 2:28 pm" (not to mention that it puts the year with the rest of the date!). Many thanks and all the credit goes to Goose for his time display mod, which gave me the idea and basis for the total mod I have here. By the way, I also had both of these mods in my 4.12 source, so they are downward compatable, you just have to find the right source file to make the changes in. v1.6 Upgrade for 4.22 code. v1.5 Removed duplicate addition of atime(). v1.0 Initial version Before using this or any mod, back up your source !!!!! PKZIP source *.c *.h *.mak 1. Load up FCNS.H and add the following line as shown. (Or, MAKE FCNS before you re-compile, whichever is easier for you.) int lcs(); void checka(int *abort, int *next); void pla(char *s, int *abort); char *ctim(double d); char *ctim2(double d); /* ADD */ int sysop2(); 2. Search down farther and make the changes shown. char *date(); char *times(); char *atime(); /* ADD */ unsigned int finduser(char *s); void changedsl(); 3. Save FCNS.H and load BBSUTL.C. Add the following procedure, right after char *ctim(). char *ctim2(double d) /* ADD FUNCTION */ { static char ch2[81]; char ht[20],mt[20],st[20]; long h,m,s; h=(long) (d/3600.0); d-=(double) (h*3600); m=(long) (d/60.0); d-=(double) (m*60); s=(long) (d); if (h==0) strcpy(ht,""); else sprintf(ht,"2%ld 3%s",h,(h>1)?"hours":"hour"); if (m==0) strcpy(mt,""); else sprintf(mt,"2%ld 3%s",m,(m>1)?"minutes":"minute"); if (s==0) strcpy(st,""); else sprintf(st,"2%ld 3%s",s,(s>1)?"seconds":"second"); if (h==0) { if (m==0) { if (s==0) { strcpy(ch2," "); } else { strcpy(ch2,st); } } else { strcpy(ch2,mt); if (s!=0) { strcat(ch2,", "); strcat(ch2,st); } } } else { strcpy(ch2,ht); if (m==0) { if (s!=0) { strcat(ch2,", "); strcat(ch2,st); } } else { strcat(ch2,", "); strcat(ch2,mt); if (s!=0) { strcat(ch2,", "); strcat(ch2,st); } } } return(ch2); } 4. Save BBSUTL.C and load up XFER.C. Search for the int printfileinfo() procedure and make the changes shown. v1.6 NOTE: Wayne changed the following code in version 4.22, so if you are using 4.22, skip to the next code block. The following block is for 4.21a and under only. npr("Filename : %s\r\n", stripfn(u->filename)); npr("Description: %s\r\n", u->description); npr("File size : %dk\r\n", ((u->numbytes)+1023)/1024); npr("Apprx. time: %s\r\n", ctim2(d)); /* CHANGE (Add '2') */ npr("Uploaded on: %s\r\n", u->date); v1.6 NOTE: Okay, here is the code for 4.22 versions. outstr(get_string(746)); pl(stripfn(u->filename)); outstr(get_string(747)); pl(u->description); outstr(get_string(748)); npr("%dk\r\n", ((u->numbytes)+1023)/1024); outstr(get_string(749)); pl(ctim2(d)); /* CHANGE (Add '2') */ outstr(get_string(750)); pl(u->date); outstr(get_string(751)); pl(u->upby); 5. Save XFER.C and load up BATCH.C. Search for void listbatch() and make the changes shown. v1.6 NOTE: Again, code is seperated here for 4.21a and under. If you run 4.22, see the block after the one below. abort=0; nl(); if (numbatchdl) npr("Files - %d Time - %s\r\n",numbatch,ctim2(batchtime)); /* CHANGE */ else npr("Files - %d\r\n",numbatch); nl(); v1.6 NOTE: Here's the 4.22 block of code: npr("%d ",numbatch); if (numbatchdl) { outstr(get_string(865)); pl(ctim2(batchtime)); /* CHANGE - add '2' */ } else nl(); 6. Now search for void ymbatchdl() and make the changes shown. v1.6 NOTE: Code split again. Here is the 4.21a and under code: if (!incom) return; sprintf(s,"Ymodem BATCH DL, %d files, time=%s",numbatchdl, ctim2(batchtime)); if (had) /* CHANGE ABOVE LINE */ strcat(s,", HAD"); v1.6 NOTE: And here is the 4.22 code: if (!incom) return; /* ADD THE '2' IN THE LINE BELOW ! */ sprintf(s,get_stringx(1,57),numbatchdl, ctim2(batchtime)); if (had) strcat(s,get_stringx(1,58)); sysoplog(s); 7. Go to step 8. 8. Now search for void dszbatchdl() and make the changes. v1.6 NOTE: Here is the 4.21a and under code: sprintf(dl,"%s BATCH DL, %d files, time=%s", desc, numbatchdl, ctim2(batchtime)); /* CHANGE */ if (had) strcat(dl,", HAD"); sysoplog(dl); nl(); pl(dl); v1.6 NOTE: Here is the 4.22 code: sprintf(dl,get_stringx(1,61), desc, numbatchdl, ctim2(batchtime)); /* ADD THE 2 THERE ! */ if (had) strcat(dl,get_stringx(1,58)); sysoplog(dl); nl(); pl(dl); 9. Save BATCH.C and load BBS.C. Search for void mainmenu() and make the changes shown. Note that most modders change this part of the code, you just need to change ctim() to ctim2(). if ((sysstatus_expert & thisuser.sysstatus)==0) printmenu(0); nl(); nl(); tleft(1); npr("T - %s\r\n",ctim2(nsl())); /* CHANGE */ s1[0]=0; 10. Search down further and continue. v1.6 NOTE: You know the drill. 4.21a and under code: if (yn()) { outchr(12); npr("Time on = %s\r\n",ctim2(timer()-timeon)); /* CHANGE */ printfile("LOGOFF"); hangup=1; } break; v1.6 NOTE: 4.22 code: if (yn()) { outchr(12); outstr(get_string(29)); pl(ctim2(timer()-timeon)); /* CHANGE - add 2 */ printfile("LOGOFF"); hangup=1; } break; 11. Now in void dlmainmenu() make the changes shown. nl(); nl(); tleft(1); npr("T - %s\r\n",ctim2(nsl())); /* CHANGE */ s1[0]=0; if (udir[curdir].subnum==-1) { 12. Scroll down further and continue. v1.6 NOTE: 4.21a and under code: if (yn()) { outchr(12); npr("Time on = %s\r\n",ctim2(timer()-timeon)); /* CHANGE */ printfile("LOGOFF"); hangup=1; } break; v1.6 NOTE: 4.22 code: if (yn()) { outchr(12); outstr(get_string(29)); pl(ctim2(timer()-timeon)); /* CHANGE - add 2 */ printfile("LOGOFF"); hangup=1; } break; 13. Save BBS.C and load SR.C. Search for void send_file() and make the changes. Note that the line changed was too long for the editor, so I moved it down so you could see it. v1.6 NOTE: 4.21a and under code: pl("File added to batch queue."); sprintf(s,"Batch: Files - %d Time - %s",numbatch, ctim2(batchtime)); /* CHANGE */ nl(); pl(s); nl(); *sent=0; v1.6: 4.22 code: nl(); pl(get_string(903)); sprintf(s,"%s - %d %s - %s",get_string(904), numbatch, get_string(905),ctim2(batchtime)); nl(); /* ADD THE 2 TO THE LINE ABOVE ! */ pl(s); nl(); *sent=0; *abort=0; 14. Save SR.C and load COM.C. Search for void ptime() and replace it with the function below. void ptime() /* REPLACE ENTIRE FUNCTION */ { char xl[81], cl[81], atr[81], cc, s[81]; long l; savel(cl, atr, xl, &cc); ansic(0); nl(); nl(); strcpy(s,atime()); pl(s); if (useron) { npr("1Time on = %s\r\n", ctim2(timer() - timeon)); npr("1Time left = %s\r\n", ctim2(nsl())); } nl(); restorel(cl, atr, xl, &cc); } 15. Removed by TFC. It is no longer needed. Go to 16. 16. Save BBSUTL.C and load XFERTMP.C. Search for the void download_temp_arc() and make the changes shown. v1.6 NOTE: 4.21a and under code: if (d<=nsl()) { npr("Approx. time: %s\r\n",ctim2(d)); /* CHANGE */ sent=0; abort=0; sprintf(s,"TEMP.%s",syscfg.arcs[ARC_NUMBER].extension); send_file(s1,&sent,&abort,0,s,-1,numbytes); v1.6 NOTE: v4.22 code: outstr(get_string(851)); pl(ctim2(d)); /* CHANGE - add '2' */ sent=0; abort=0; sprintf(s,"%s.%s",fn,syscfg.arcs[ARC_NUMBER].extension); send_file(s1,&sent,&abort,0,s,-1,numbytes); if (sent) { if (xfer) { ++thisuser.downloaded; 17. Save XFERTMP.C and load UTILITY.C. Search for unsigned int finduser() and add the following function right before it. char *atime() /* ADD ENTIRE FUNCTION */ { static char dt[81]; char dow[10],mon[10],ap[10]; int i,d,y; union REGS r; r.h.ah = 0x2a; r.h.al = 0; int86(0x21, &r, &r); switch (r.h.al) { case 0 : strcpy(dow,"Sunday"); break; case 1 : strcpy(dow,"Monday"); break; case 2 : strcpy(dow,"Tuesday"); break; case 3 : strcpy(dow,"Wednesday"); break; case 4 : strcpy(dow,"Thursday"); break; case 5 : strcpy(dow,"Friday"); break; case 6 : strcpy(dow,"Saturday"); break; } switch (r.h.dh) { case 1 : strcpy(mon,"January"); break; case 2 : strcpy(mon,"February"); break; case 3 : strcpy(mon,"March"); break; case 4 : strcpy(mon,"April"); break; case 5 : strcpy(mon,"May"); break; case 6 : strcpy(mon,"June"); break; case 7 : strcpy(mon,"July"); break; case 8 : strcpy(mon,"August"); break; case 9 : strcpy(mon,"September"); break; case 10 : strcpy(mon,"October"); break; case 11 : strcpy(mon,"November"); break; case 12 : strcpy(mon,"December"); break; } d=r.h.dl; y=r.x.cx; r.h.ah = 0x2c; r.h.al = 0; int86(0x21, &r, &r); i=r.h.ch; if (i>12) i-=12; if (i==0) i=12; if (r.h.ch<12) strcpy(ap,"am"); else strcpy(ap,"pm"); sprintf(dt,"3%s, %s %d, %4d 1%2d:%02d %s",dow,mon,d,y,i,r.h.cl,ap); return(dt); } 18. Save UTILITY.C and load MSGBASE.C. Search for void inmsg() scroll down some, and make the changes shown. if (real_name) addline(b,thisuser.realname,&l1); else addline(b,nam1(&thisuser,usernum,syscfg.systemnumber),&l1); time(&ll); /* DELETE THIS LINE */ strcpy(s,ctime(&ll)); /* DELETE THIS LINE */ s[strlen(s)-1]=0; /* DELETE THIS LINE */ strcpy(s,atime()); /* ADD THIS LINE */ addline(b,s,&l1); 19. Save MSGBASE.C. DISCLAIMER: I make no guarantees with this mod whatsoever. Your installation of the mod is your acceptance of any damages caused to your hardware or software, incendental or otherwise. The mod was tested with the versions of WWIV mentioned in this file. If the mod does NOT work for you, e-mail one of the addresses above, and tell me EXACTLY what you did, what the screen said, and what you did to try to fix it, and I'll do what I can to help you out. PLEASE REPORT ANY BUGS TO ME AT THE ABOVE ADDRESS !!!!!!! Any other comments, suggestions, hints, things I missed, requests for new mods, and general "Thank you!"s are all VERY welcomed, so drop me a line. I don't mind updates to this mod, but do request that you send me a courtesy copy of the changes you made. ***************************************************************** Subscribe to: Modding with WWIV's Flying Chicken WWIVLink subtype 42456, Host @12456 (REQable) WWIVNet subtype 42456, Host @2456 (REQable) IceNet subtype 42456, Host @2456 (REQable) All mods are released on this sub first. Occasionally, they make the mods subs, but usually much later. Subscribe now! ***************************************************************** The Flying Chicken 1@12456 (WWIVLink) - 1@2456 (WWIVNet) - 1@2456 (IceNet) THE INSANE ASYLUM BBS In Operation Since August, 1989 Running WWIV 4.22++ (Reg #21260) SysOp: The Flying Chicken - CoSysOp: Dr. Doolittle Snarfable - Auto-SysOp Validation Callback Validation (Local calls only) (214) 570-5950 - USR Dual Std (v32/HST) --- END OF LINE ---