home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / MODS / FMD-04A.ZIP / FMD-04A.MOD < prev    next >
Encoding:
Text File  |  1995-06-09  |  6.3 KB  |  216 lines

  1. Spotnick #1 @20397
  2. Mon Jun 05 02:05:30 1995
  3. 0R 34 06/09 07:13 WWIVNET 4051->8421
  4. 0R 34 06/08 18:18 WWIVNet 4001->4051
  5. 0R 34 06/08 14:07 WWIVnet 4000->4001
  6. 0R 34 06/08 05:34 WWIVnet ->4000
  7. 0R 34 06/05 22:43 WWIVnet 4001->4000
  8. 0R 34 06/06 06:35 WWIVnet 20001->4001
  9. 0R 34 06/05 02:07 WWIVnet 20397->20001
  10. 0R 34 06/05 02:10 WWIVnet ->20397
  11.  
  12.    ┌┬─── ──  ─   ─  ── ───────────────────────────────────────────────────┬─ ∙∙
  13.    ││                    Alternative Worlds Presents                      │
  14.    └┼─────────────────────────────────────────────────────────────────────┐
  15.    ││ Mod Name       » FMD-04a.MOD                                        │∙
  16.    ││ Difficulty     » █▒▒▒▒▒▒▒▒▒▒ (1/10)                                 │:
  17.    ││ WWIV Version   » 4.24                                               ││
  18.    ││ Date Affected  » 06/01/95                                           ││
  19.    :│ Files Affected » MISCCMD.C / MMENU.C / NEWUSER.C / COM.C            ││
  20.    ∙│ Description    » Top 5 Upload/Download While Entering Xfer Section  ││
  21.     └─────────────────────────────────────────────────────────────────────┼┐
  22.     │       A French Mod Division Release - (C) 1995 FMD Software         ││
  23. ∙∙ ─┴─────────────────────────────────────────────────── ──  ─   ─  ── ───└┘
  24.  
  25.  
  26.  ┌┬══════════════════┐
  27.  ││ Long Description ││
  28.   └══════════════════┴┘
  29.  
  30.         This mod will show a top 5 upload/download when entering the file
  31.         section, it's Vision-X look-alike, converting some colors too.
  32.         Installation is easy.
  33.  
  34. Revision A:
  35.  
  36.  - Updated for WWIV v4.24
  37.  
  38.  ┌┬═══════┐
  39.  ││ Tests ││
  40.   └═══════┴┘
  41.  
  42.   This modification has been tested on a virgin WWIV v4.24 source using
  43.   Borland C++ v4.5
  44.  
  45.  
  46. ──────────────────────────────────────────────────────────────────────────────
  47.                                    Legend
  48.                           ╔═══╤══════════════════┐
  49.                           │ + │ Add This Line    │
  50.                           │ - │ Delete This Line │
  51.                           │ * │ Modify This Line │
  52.                           │ = │ Existing Line    │
  53.                           └═══╧══════════════════╝
  54. ───[Step 1]────────────────────────────────────────────────────────────────────
  55.  
  56. Load COM.C and add the following function to the end of the file:
  57. (You might already have this function if you installed other FMD mods)
  58.  
  59. void litebar(char *fmt, ...)
  60. {
  61.   va_list ap;
  62.   char s[512], s2[250];
  63.   
  64.   va_start(ap, fmt);
  65.   vsprintf(s, fmt, ap);
  66.   va_end(ap);
  67.   
  68.   if (okansi()) 
  69.   {
  70.     npr("\x1B[0;1m%s\r\n", charstr(strlen(s)+6, '▄'));
  71.     sprintf(s2, "\x1B[0;34;47m ∙ %s ∙ \x1B[40m", stripcolors(s));
  72.     pl(s2);
  73.     npr("\x1B[0;1;30m%s\r\n", charstr(strlen(s)+6, '▀'));
  74.   } else
  75.     pl(s);
  76.   ansic(0);
  77. }
  78.  
  79. ───[Step 2]────────────────────────────────────────────────────────────────────
  80.  
  81. Load MISCCMD.C and copy the following function at the end of the file:
  82.  
  83. void top_ul_dl(void)
  84. {
  85.   userrec u;
  86.   int i, tt, i1, num_users, j, flag, last, c1;
  87.   unsigned long ukpu[10], dkpu[10], sl;
  88.   float tpu[10];
  89.   char s[2][10][40], sc[40], s1[81], s2[250];
  90.   
  91.   
  92.   c1= thisuser.colors[8];
  93.   thisuser.colors[8]= 13;
  94.   
  95.   for (i= 0; i<5; i++)
  96.   {
  97.     ukpu[i]= 0;
  98.     dkpu[i]= 0;
  99.     tpu[i]= 0;
  100.   }
  101.   for (i= 0; i<2; i++)
  102.     for (i1= 0; i1<5; i1++) strcpy(s[i][i1], "■ Empty ■");
  103.   
  104.   for (i= 0; i<status.users; i++)
  105.   {
  106.     read_user(smallist[i].number, &u);
  107.     if (u.sl<255) 
  108.     {
  109.       sl= ukpu[0];
  110.       j= 0;
  111.       for (i1= 1; i1<5; i1++)
  112.         if (ukpu[i1]<sl)
  113.         {
  114.           j= i1;
  115.           sl= ukpu[i1];
  116.         }
  117.       if (u.uk>sl) 
  118.       {
  119.         ukpu[j]= u.uk;
  120.         strcpy(s[0][j], u.name);
  121.         properize(s[0][j]);
  122.       }
  123.       sl= dkpu[0];
  124.       j= 0;
  125.       for (i1= 1; i1<5; i1++)
  126.         if (dkpu[i1]<sl) 
  127.         {
  128.           j= i1; sl= dkpu[i1];
  129.         }
  130.       if (u.dk>sl) 
  131.       {
  132.         dkpu[j]= u.dk;
  133.         strcpy(s[1][j], u.name);
  134.         properize(s[1][j]);
  135.       }
  136.     }
  137.   }
  138.   for (i= 0; i<5; i++)
  139.     tpu[i]= (tpu[i]/60);
  140.   for (j= 0; j<5; j++)
  141.     for (i= j+1; i<5; i++)
  142.     {
  143.       if (ukpu[i]>ukpu[j])
  144.       {
  145.         sl= ukpu[i];
  146.         ukpu[i]= ukpu[j];
  147.         ukpu[j]= sl;
  148.         strcpy(sc, s[0][i]);
  149.         strcpy(s[0][i], s[0][j]);
  150.         strcpy(s[0][j], sc);
  151.       }
  152.       if (dkpu[i]>dkpu[j])
  153.       {
  154.         sl= dkpu[i]; dkpu[i]= dkpu[j]; dkpu[j]= sl;
  155.         strcpy(sc, s[1][i]);
  156.         strcpy(s[1][i], s[1][j]);
  157.         strcpy(s[1][j], sc);
  158.       }
  159.     }
  160.   outchr(12);
  161.   litebar("Highest Uploads/Downloads");
  162.   nl();
  163.   pl("1Top 5 Uploaders");
  164.   nl();
  165.   
  166.   for (i= 0; i<5; i++) 
  167.   {
  168.     npr("9%d3.  8%s3%s 7%6.3f Megs Uploaded\r\n", i+1, s[0][i], charstr(30-strlen(s[0][i]), '.'), (float)ukpu[i]/1024);
  169.   }
  170.   nl();
  171.   pl("1Top 5 Downloders");
  172.   nl();
  173.   for (i= 0; i<5; i++) 
  174.   {
  175.     npr("9%d3.  8%s3%s 7%6.3f Megs Downloaded\r\n", i+1, s[1][i], charstr(30-strlen(s[1][i]), '.'), (float)dkpu[i]/1024);
  176.   }
  177.   nl();
  178.   thisuser.colors[8]= c1;
  179.   if ((sysstatus_expert & thisuser.sysstatus)==0)
  180.     pausescr();
  181. }
  182.  
  183.  
  184. ───[Step 3]────────────────────────────────────────────────────────────────────
  185.  
  186. Load MMENU.C and do the following change in void mainmenu:
  187.  
  188. =          write_inst(INST_LOC_XFER,udir[curdir].subnum,INST_FLAGS_ONLINE);
  189. =          curdloads=1;
  190. *          if (existprint(get_string(1037)))
  191. +            pausescr();
  192. +          top_ul_dl();
  193.  
  194. ───[Step 4]────────────────────────────────────────────────────────────────────
  195.  
  196. You will need to do MAKE FCNS right now, and recompile the entire BBS, We hope
  197. you will enjoy the modification
  198.  
  199. French Proverb: Ne donnez pas de perles à un cochon.
  200.  
  201. For comments, bug report and suggestion, e-mail at the following address:
  202.  
  203. Nicolas LeBlanc  2@20302.WWIVnet (aka Spotnick)
  204.                  -> spotnick@gamemaster.qc.ca
  205. Martin Bourdages 242@20306 / 3@20302.WWIVnet (aka Dark Shadow)
  206.                  -> martin.bourdages@radio.magicnet.com
  207.  
  208.                  =>   French Mod Division Support Sub   <=
  209.                                 SubType: FMD
  210.                            Host: @20302 (WWIVnet)
  211.                       Scan sublist for other networks
  212.  
  213.         Read PRODUCTS.FMD for the full list of our support systems.
  214.  
  215. ───[EOF]──────────────────────────────────────────────────────────────────────
  216.