home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / MODS / ALLMODS.ZIP / FMD-37A.ZIP / FMD-37A.MOD < prev    next >
Encoding:
Text File  |  1995-06-22  |  6.9 KB  |  232 lines

  1. Nicolas Leblanc #2 @20302
  2. Sun Jun 18 23:41:12 1995
  3.    ┌┬─── ──  ─   ─  ── ───────────────────────────────────────────────────┬─ ∙∙
  4.    ││                    Alternative Worlds Presents                      │
  5.    └┼─────────────────────────────────────────────────────────────────────┐
  6.    ││ Mod Name       » FMD-37a.MOD                                        │∙
  7.    ││ Difficulty     » █▒▒▒▒▒▒▒▒▒▒ (1/10)                                 │:
  8.    ││ WWIV Version   » 4.24                                               ││
  9.    ││ Date Affected  » 06/01/95                                           ││
  10.    :│ Files Affected » MMENU.C / MISCCMD.C                                ││
  11.    ∙│ Description    » New System Informations For WWIV                   ││
  12.     └─────────────────────────────────────────────────────────────────────┼┐
  13.     │       A French Mod Division Release - (C) 1995 FMD Software         ││
  14. ∙∙ ─┴─────────────────────────────────────────────────── ──  ─   ─  ── ───└┘
  15.  
  16.  
  17.  ┌┬══════════════════┐
  18.  ││ Long Description ││
  19.   └══════════════════┴┘
  20.  
  21.         If you ever saw the Vision-X System information, well, this is it!
  22. For WWIV!
  23.  
  24. Revision A:
  25.  
  26.  - Updated for WWIV v4.24
  27.  
  28.  ┌┬═══════┐
  29.  ││ Tests ││
  30.   └═══════┴┘
  31.  
  32.   This modification has been tested on a virgin WWIV v4.24 source using
  33.   Borland C++ v4.5
  34.  
  35. ──────────────────────────────────────────────────────────────────────────────
  36.                                    Legend
  37.                           ╔═══╤══════════════════┐
  38.                           │ + │ Add This Line    │
  39.                           │ - │ Delete This Line │
  40.                           │ * │ Modify This Line │
  41.                           │ = │ Existing Line    │
  42.                           └═══╧══════════════════╝
  43. ───[Step 1]────────────────────────────────────────────────────────────────────
  44.  
  45. Add the following functions in at the end of MISCCMD.C:
  46.  
  47. void sysinfo_zlog(void)
  48. {
  49.   zlogrec z;
  50.   char s[81];
  51.   int abort,f,i,i1,c1,c2,c3;
  52.  
  53.  
  54.   c1=thisuser.colors[4];
  55.   c2=thisuser.colors[6];
  56.   c3=thisuser.colors[8];
  57.   thisuser.colors[4]=8;
  58.   thisuser.colors[6]=13;
  59.   thisuser.colors[8]=1;
  60.   sprintf(s,"%sZLOG.DAT",syscfg.datadir);
  61.   f=sh_open1(s,O_RDONLY | O_BINARY);
  62.   if (f<0)
  63.     return;
  64.   i=0;
  65.   abort=0;
  66.   sh_read(f,(void *)&z,sizeof(zlogrec));
  67.   while ((i<3) && (!abort) && (!hangup) && (z.date[0]!=0)) {
  68.     if (z.calls)
  69.       i1=z.active/z.calls;
  70.     else
  71.       i1=0;
  72.     sprintf(s,"3%s    7%4d    9%4d     4%3d     8%3d     3%3d    7%3d     6%3d      3%3d",
  73.          z.date,z.calls,z.active,z.posts,z.email,z.fback,z.up,10*z.active/144,i1);
  74.     pla(s,&abort);
  75.     ++i;
  76.     if (i<3) {
  77.       sh_lseek(f,((long) i) * sizeof(zlogrec),SEEK_SET);
  78.       sh_read(f,(void *)&z,sizeof(zlogrec));
  79.     }
  80.   }
  81.   sh_close(f);
  82.   thisuser.colors[4]=c1;
  83.   thisuser.colors[6]=c2;
  84.   thisuser.colors[8]=c3;
  85. }
  86.  
  87.  
  88. void sysinfo(void)
  89. {
  90.  int c1;
  91.  
  92.  c1=thisuser.colors[8];
  93.  thisuser.colors[8]=8;
  94.  outchr(12);
  95.  litebar3("[ %s System Status ]", wwiv_version);
  96.  nl();
  97.  square(1,4,47,11,8,0);
  98.  goxy(5,4);
  99.  npr("7[9 Main Status 7]");
  100.  goxy(4,5);
  101.  npr("7Board Name...: 3%-26.26s",syscfg.systemname);
  102.  goxy(4,6);
  103.  npr("7SysOps Name..: 3%-26.26s",syscfg.sysopname);
  104.  goxy(4,7);
  105.  npr("7Total Users..: 3%d",status.users);
  106.  goxy(4,8);
  107.  npr("7Total Callers: 3%d",status.callernum1);
  108.  goxy(4,9);
  109.  npr("7Calls Today..: 3%d",status.callstoday);
  110.  goxy(4,10);
  111.  /* npr("7Calls per Day: 3%.2f",(status.callernum1/(atof(status.days)))); */
  112.  /* Warning: Enable the previous line ONLY if using FMD-02.MOD */
  113.  square(49,4,78,11,8,0);
  114.  goxy(52,5);
  115.  npr("7Uploads Today.: 3%d",status.uptoday);
  116.  goxy(52,6);
  117.  npr("7Messages Today: 3%d",status.msgposttoday);
  118.  goxy(52,7);
  119.  npr("7System PCR....: 3%.3f",syscfg.post_call_ratio);
  120.  goxy(52,8);
  121.  npr("7Comm Port.....: 3%d",syscfg.primaryport);
  122.  goxy(1,13);
  123.  pl("7Date        Calls  Active   Posts   Email   Fback    U/L    %Act   T/user");
  124.  pl("8──────────────────────────────────────────────────────────────────────────────");
  125.  thisuser.colors[8]=c1;
  126.  sysinfo_zlog();
  127.  goxy(1,20);
  128.  if ((sysstatus_expert & thisuser.sysstatus)==0)
  129.    pausescr();
  130. }
  131.  
  132. ───[Step 2]────────────────────────────────────────────────────────────────────
  133.  
  134. Add the following functions at the end of COM.C (You might already have them):
  135.  
  136.  
  137. void litebar3(char *fmt, ...)
  138. {
  139.   int i;
  140.   va_list ap;
  141.   char s[512], s1[512], s2[250];
  142.   
  143.   va_start(ap, fmt);
  144.   vsprintf(s, fmt, ap);
  145.   va_end(ap);
  146.  
  147.    i=(74-strlen(s))/2;
  148.   if (okansi())
  149.   {
  150.     sprintf(s1,"%s%s%s",charstr(i,' '),stripcolors(s),charstr(i,' '));
  151.     npr("\x1B[0;1;36m%s\r\n",charstr(strlen(s1)+4,'▄'));
  152.     npr("\x1B[0;30;46m ∙%s∙ \x1B[40m\r\n",s1);
  153.     npr("\x1B[0;1;30m%s\r\n",charstr(strlen(s1)+4,'▀'));
  154.   } else {
  155.     npr("%s%s\r\n", charstr(i,' '), s);
  156.   }
  157. }
  158.  
  159. void prlocate1(int x, int y, int c1, int c2, char *fmt, ...)
  160. /* Output a fast string at a given position */
  161. {
  162.   va_list ap;
  163.   char s[512];
  164.  
  165.   va_start(ap, fmt);
  166.   vsprintf(s, fmt, ap);
  167.   va_end(ap);
  168.   goxy(x, y);
  169.   setc(c2*16+c1);
  170.   npr(s);
  171. }
  172.  
  173. void square(int x , int y , int x1 , int y1, int c1, int c2)
  174. {
  175.   int i;
  176.  
  177.   if (y1>25)
  178.     y1= 25;
  179.   prlocate1(x, y, c1, c2, "┌%s┐", charstr((x1-x)-1, '─'));
  180.   for (i= y+1; i<y1; ++i) {
  181.     prlocate1(x, i, c1, c2, "└%s┘", charstr((x1-x)-1, '─'));
  182.     prlocate1(x, i, c1, c2, "│%s│", charstr((x1-x)-1, ' '));
  183.   }
  184.   prlocate1(x, y1, c1, c2, "└%s┘", charstr((x1-x)-1, '─'));
  185. }
  186.  
  187. ───[Step 3]────────────────────────────────────────────────────────────────────
  188.  
  189. Load MMENU.C and do the following change to void mainmenu.
  190.  
  191. =      case 'H':
  192. =        hop_sub();
  193. =        break;
  194. =      case 'I':
  195. =        nl();
  196. =        if (menu_on()) {
  197. =          printmenu(328);
  198. =          getkey();
  199. =          rip_pcb();
  200. =        }
  201. =        npr("%s   (%s)\r\n",wwiv_version, wwiv_date);
  202. =        nl();
  203. =        existprint(get_string(1033));
  204. =        existprint(get_string(1034));
  205. +        pausescr();
  206. +        sysinfo();
  207. =        break;
  208. =      case 'J':
  209. =        if (okconf(&thisuser))
  210.  
  211. ───[Step 4]────────────────────────────────────────────────────────────────────
  212.  
  213. That's it. Do a MAKE FCNS and recompile the entire system.
  214.  
  215. French Proverb: Il n'est point de sot métiers.
  216.  
  217. For comments, bug report and suggestion, e-mail at the following address:
  218.  
  219. Nicolas LeBlanc  2@20302.WWIVnet (aka Spotnick)
  220.                  -> spotnick@gamemaster.qc.ca
  221. Martin Bourdages 242@20306 / 3@20302.WWIVnet (aka Dark Shadow)
  222.                  -> martin.bourdages@radio.magicnet.com
  223.  
  224.                  =>   French Mod Division Support Sub   <=
  225.                                 SubType: FMD
  226.                            Host: @20302 (WWIVnet)
  227.                       Scan sublist for other networks
  228.  
  229.         Read PRODUCTS.FMD for the full list of our support systems.
  230.  
  231. ───[EOF]──────────────────────────────────────────────────────────────────────
  232.