home *** CD-ROM | disk | FTP | other *** search
- Nicolas Leblanc #2 @20302
- Fri Jun 30 02:53:07 1995
- ┌┬─── ── ─ ─ ── ───────────────────────────────────────────────────┬─ ∙∙
- ││ Alternative Worlds Presents │
- └┼─────────────────────────────────────────────────────────────────────┐
- ││ Mod Name » FMD-04b.MOD │∙
- ││ Difficulty » █▒▒▒▒▒▒▒▒▒▒ (1/10) │:
- ││ WWIV Version » 4.24 ││
- ││ Date Affected » 06/01/95 ││
- :│ Files Affected » MISCCMD.C / MMENU.C / NEWUSER.C / COM.C ││
- ∙│ Description » Top 5 Upload/Download While Entering Xfer Section ││
- └─────────────────────────────────────────────────────────────────────┼┐
- │ A French Mod Division Release - (C) 1995 FMD Software ││
- ∙∙ ─┴─────────────────────────────────────────────────── ── ─ ─ ── ───└┘
-
-
- ┌┬══════════════════┐
- ││ Long Description ││
- └══════════════════┴┘
-
- This mod will show a top 5 upload/download when entering the file
- section, it's Vision-X look-alike, converting some colors too.
- Installation is easy.
-
- Revision A:
-
- - Updated for WWIV v4.24
-
- Revision B:
-
- - Now showing the top 5 only once, then prompt user if he wants to see it
- again (original idea from Zu Digital)
- - Added a "Please Wait" message, because when you have a large user list,
- it's long to compile the statistics.
-
- ┌┬═══════┐
- ││ Tests ││
- └═══════┴┘
-
- This modification has been tested on a virgin WWIV v4.24 source using
- Borland C++ v4.5
-
-
- ──────────────────────────────────────────────────────────────────────────────
- Legend
- ╔═══╤══════════════════┐
- │ + │ Add This Line │
- │ - │ Delete This Line │
- │ * │ Modify This Line │
- │ = │ Existing Line │
- └═══╧══════════════════╝
- ───[Step 1]────────────────────────────────────────────────────────────────────
-
- Load COM.C and add the following function to the end of the file:
- (You might already have this function if you installed other FMD mods)
-
- void litebar(char *fmt, ...)
- {
- va_list ap;
- char s[512], s2[250];
-
- va_start(ap, fmt);
- vsprintf(s, fmt, ap);
- va_end(ap);
-
- if (okansi())
- {
- npr("\x1B[0;1m%s\r\n", charstr(strlen(s)+6, '▄'));
- sprintf(s2, "\x1B[0;34;47m ∙ %s ∙ \x1B[40m", stripcolors(s));
- pl(s2);
- npr("\x1B[0;1;30m%s\r\n", charstr(strlen(s)+6, '▀'));
- } else
- pl(s);
- ansic(0);
- }
-
- ───[Step 2]────────────────────────────────────────────────────────────────────
-
- Load MISCCMD.C and copy the following function at the end of the file:
-
- void top_ul_dl(void)
- {
- userrec u;
- int i, i1, j, c1;
- unsigned long ukpu[10], dkpu[10], sl;
- float tpu[10];
- char s[2][10][40], sc[40];
-
-
- c1= thisuser.colors[8];
- thisuser.colors[8]= 13;
-
- if (g_flags & g_flag_files_top_5)
- {
- nl();
- prt(5,"See top five again? ");
- if (!yn())
- return;
- } else
- g_flags |= g_flag_files_top_5;
- prt(3,"Please wait...");
- for (i= 0; i<5; i++)
- {
- ukpu[i]= 0;
- dkpu[i]= 0;
- tpu[i]= 0;
- }
- for (i= 0; i<2; i++)
- for (i1= 0; i1<5; i1++) strcpy(s[i][i1], "■ Empty ■");
-
- for (i= 0; i<status.users; i++)
- {
- read_user(smallist[i].number, &u);
- if (u.sl<255)
- {
- sl= ukpu[0];
- j= 0;
- for (i1= 1; i1<5; i1++)
- if (ukpu[i1]<sl)
- {
- j= i1;
- sl= ukpu[i1];
- }
- if (u.uk>sl)
- {
- ukpu[j]= u.uk;
- strcpy(s[0][j], u.name);
- properize(s[0][j]);
- }
- sl= dkpu[0];
- j= 0;
- for (i1= 1; i1<5; i1++)
- if (dkpu[i1]<sl)
- {
- j= i1; sl= dkpu[i1];
- }
- if (u.dk>sl)
- {
- dkpu[j]= u.dk;
- strcpy(s[1][j], u.name);
- properize(s[1][j]);
- }
- }
- }
- for (i= 0; i<5; i++)
- tpu[i]= (tpu[i]/60);
- for (j= 0; j<5; j++)
- for (i= j+1; i<5; i++)
- {
- if (ukpu[i]>ukpu[j])
- {
- sl= ukpu[i];
- ukpu[i]= ukpu[j];
- ukpu[j]= sl;
- strcpy(sc, s[0][i]);
- strcpy(s[0][i], s[0][j]);
- strcpy(s[0][j], sc);
- }
- if (dkpu[i]>dkpu[j])
- {
- sl= dkpu[i]; dkpu[i]= dkpu[j]; dkpu[j]= sl;
- strcpy(sc, s[1][i]);
- strcpy(s[1][i], s[1][j]);
- strcpy(s[1][j], sc);
- }
- }
- outchr(12);
- litebar("Highest Uploads/Downloads");
- nl();
- pl("1Top 5 Uploaders");
- nl();
-
- for (i= 0; i<5; i++)
- {
- 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);
- }
- nl();
- pl("1Top 5 Downloders");
- nl();
- for (i= 0; i<5; i++)
- {
- 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);
- }
- nl();
- thisuser.colors[8]= c1;
- if ((sysstatus_expert & thisuser.sysstatus)==0)
- pausescr();
- }
-
-
- ───[Step 3]────────────────────────────────────────────────────────────────────
-
- Load VARDEC.H and add the following line:
-
- = #define g_flag_allow_extended 0x00000020
- = #define g_flag_disable_mci 0x00000040
- + #define g_flag_files_top_5 0x00000080
- =
- = #define PREV 1
-
- ───[Step 4]────────────────────────────────────────────────────────────────────
-
- Load MMENU.C and do the following change in void mainmenu:
-
- = write_inst(INST_LOC_XFER,udir[curdir].subnum,INST_FLAGS_ONLINE);
- = curdloads=1;
- * if (existprint(get_string(1037)))
- + pausescr();
- + top_ul_dl();
-
- ───[Step 4]────────────────────────────────────────────────────────────────────
-
- You will need to do MAKE FCNS right now, and recompile the entire BBS, We hope
- you will enjoy the modification
-
- French Proverb: Ne donnez pas de perles à un cochon.
-
- For comments, bug report and suggestion, e-mail at the following address:
-
- Nicolas LeBlanc 2@20302.WWIVnet (aka Spotnick)
- -> spotnick@gamemaster.qc.ca
- Martin Bourdages 242@20306 / 3@20302.WWIVnet (aka Dark Shadow)
- -> martin.bourdages@radio.magicnet.com
-
- => French Mod Division Support Sub <=
- SubType: FMD
- Host: @20302 (WWIVnet)
- Scan sublist for other networks
-
- Read PRODUCTS.FMD for the full list of our support systems.
-
- ───[EOF]──────────────────────────────────────────────────────────────────────
-