home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
SYSOP
/
MODS1.ZIP
/
KLUG003.424
< prev
next >
Wrap
Text File
|
1995-07-07
|
3KB
|
104 lines
┌─────────────────────────────────────────────────────────────────────────┐
│ Difficulty: ███▒▒▒▒▒▒▒(3/10) 2@63 DigiNet Blue Death │
│ It's not a hard MOD at all! I just did not make it clear │
│ WWIV Version: v4.24 2@4063 TERRANet │
│ Files Affected: MMENU.C SYSOPF.C LILO.C Date: 07/02/95 │
│ Ansi Graph of user activity by the HOUR! │
└─────────────────────────────────────────────────────────────────────────┘
---[Disclaimer]----------------------------------------------------------------
This mod is not fancy header/steps, it's put together in 5 min.
Might have errors; your smart; you fix it.
---[Step 1]----------------------------------------------------------------
In lilo.c, In function logon():
==logon();
++time_t t;
++FILE *fp;
++int in,tgraph[25];
.
.
.
++ gettime(&t);
++ fp=fopen("times!!!","rt");
++ for (i=1;i<25;i++) {
++ fscanf(fp,"%i ", &in);
++ tgraph[i] = in;
++ }
++ fclose(fp);
++ i = (int) t.ti_hour;
++ ++tgraph[i];
++ fp=fopen("times!!!","wt");
++ for (i=1;i<25;i++) fprintf(fp,"%i ", tgraph[i]);
++ fclose(fp);
==/****************************************************************************/
==/*
== * Do NOT remove or modify this part of the code. If the registration number
== * (or an indicator that it is unregistered) is not printed out, it will
== * be plainly obvious that this is a 'pirated' version of the source code.
== */
---[Step 2]----------------------------------------------------------------
Put this function into sysopf.c (at the end.)
/* KLUG003.424: Graph user activity by the hour */
graph2()
{
int j,total=0,i,in,tgraph[25];
float per,gr,tp=0;
char hour[10],graph[77];
FILE *fp;
fp = fopen("times!!!","rt");
for (i=1;i<25;i++) {
fscanf(fp, "%i", &tgraph[i]);
total+= tgraph[i];
}
npr("j╒══════════╤══════╤════════════════════════════════════════════════════╕");
for (i=1;i<25;i++) {
per =( (float) tgraph[i]*100) / (float) total;
tp+=per;
if (i < 13) {
itoa(i,hour,10);
strcat(hour," ja.m.");
} else {
itoa(i-12,hour,10);
strcat(hour," jp.m.");
}
npr("\r\nj│ b%9sp:j │ d%%%2.1fj │ 4",hour, per);
graph[0]=0;
for (j=1;j<gr;j++) strcat(graph,"░");
npr("%-50s0j │",graph);
// for (j=1;20;j++) fprintf("·")}
}
pl("\r\nj╘══════════╧══════╧════════════════════════════════════════════════════╛");
return 0;
}
---[Step 3]----------------------------------------------------------------
Add this into mmenu.c, mmenu()
++if ((strcmp(s,"HOUR")==0) ) {
++ //lsdprt("User Activity By Hour"); //Uncomment this line if it you got lsdprt
++ graph2();
++ sysoplog("@View Graph by hour by BD.");
++}
==if ((strcmp(s,"UPLOAD")==0) ) {
---[Step 4]----------------------------------------------------------------
Compile, you need not compile the entire bbs, or even fcns.h for that matter!
Mail me 2@63 Diginet, get DigiNet if you don't have it.
Oh YEAH, one other thing. This graph will look really screwy for the first
day or so, just so you know. If after a week, it still looks screwy (i.e.
the graph goes out of the box), change [gr=per*5;] to [gr=per*4;] or less.
Adios,
Blue Death