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 >
Text File  |  1995-07-07  |  3KB  |  104 lines

  1. ┌─────────────────────────────────────────────────────────────────────────┐
  2. │ Difficulty: ███▒▒▒▒▒▒▒(3/10)         2@63 DigiNet       Blue Death      │
  3. │ It's not a hard MOD at all!  I just did not make it clear               │
  4. │ WWIV Version: v4.24                  2@4063 TERRANet                    │
  5. │ Files Affected: MMENU.C SYSOPF.C LILO.C               Date: 07/02/95    │
  6. │ Ansi Graph of user activity by the HOUR!                                │
  7. └─────────────────────────────────────────────────────────────────────────┘
  8.  
  9. ---[Disclaimer]----------------------------------------------------------------
  10.  
  11. This mod is not fancy header/steps, it's put together in 5 min.
  12. Might have errors; your smart; you fix it.
  13.  
  14. ---[Step 1]----------------------------------------------------------------
  15.  
  16. In lilo.c, In function logon():
  17.  
  18. ==logon();
  19. ++time_t t;
  20. ++FILE *fp;
  21. ++int in,tgraph[25];
  22. .
  23. .
  24. .
  25. ++           gettime(&t);
  26. ++           fp=fopen("times!!!","rt");
  27. ++           for (i=1;i<25;i++) {
  28. ++            fscanf(fp,"%i ", &in);
  29. ++            tgraph[i] = in;
  30. ++           }
  31. ++           fclose(fp);
  32. ++           i = (int) t.ti_hour;
  33. ++           ++tgraph[i];
  34. ++           fp=fopen("times!!!","wt");
  35. ++           for (i=1;i<25;i++) fprintf(fp,"%i ", tgraph[i]);
  36. ++           fclose(fp);
  37. ==/****************************************************************************/
  38. ==/*
  39. == * Do NOT remove or modify this part of the code.  If the registration number
  40. == * (or an indicator that it is unregistered) is not printed out, it will
  41. == * be plainly obvious that this is a 'pirated' version of the source code.
  42. == */
  43.           
  44.  
  45. ---[Step 2]----------------------------------------------------------------
  46.  
  47. Put this function into sysopf.c (at the end.)
  48.  
  49. /* KLUG003.424: Graph user activity by the hour */
  50. graph2()
  51. {
  52. int j,total=0,i,in,tgraph[25];
  53. float per,gr,tp=0;
  54. char hour[10],graph[77];
  55.  
  56. FILE *fp;
  57. fp = fopen("times!!!","rt");
  58. for (i=1;i<25;i++) {
  59.   fscanf(fp, "%i", &tgraph[i]);
  60.   total+= tgraph[i];
  61. }
  62. npr("j╒══════════╤══════╤════════════════════════════════════════════════════╕");
  63. for (i=1;i<25;i++) {
  64.  per =( (float) tgraph[i]*100) / (float) total;
  65.  tp+=per;
  66. if (i < 13) {
  67.   itoa(i,hour,10);
  68.   strcat(hour," ja.m.");
  69. } else {
  70.   itoa(i-12,hour,10);
  71.   strcat(hour," jp.m.");
  72. }
  73. npr("\r\nj│ b%9sp:j │ d%%%2.1fj │ 4",hour, per);
  74. graph[0]=0;
  75. for (j=1;j<gr;j++) strcat(graph,"░");
  76. npr("%-50s0j │",graph);
  77. //  for (j=1;20;j++) fprintf("·")}
  78. }
  79. pl("\r\nj╘══════════╧══════╧════════════════════════════════════════════════════╛");
  80. return 0;
  81. }
  82.  
  83. ---[Step 3]----------------------------------------------------------------
  84.  
  85. Add this into mmenu.c, mmenu()
  86.  
  87.     ++if ((strcmp(s,"HOUR")==0) ) {
  88.     ++  //lsdprt("User Activity By Hour");  //Uncomment this line if it you got lsdprt
  89.     ++  graph2();
  90.     ++  sysoplog("@View Graph by hour by BD.");
  91.     ++}
  92.     ==if ((strcmp(s,"UPLOAD")==0) ) {
  93.  
  94. ---[Step 4]----------------------------------------------------------------
  95. Compile, you need not compile the entire bbs, or even fcns.h for that matter!
  96. Mail me 2@63 Diginet, get DigiNet if you don't have it.
  97. Oh YEAH, one other thing.  This graph will look really screwy for the first
  98. day or so, just so you know.  If after a week, it still looks screwy (i.e.
  99. the graph goes out of the box), change [gr=per*5;] to [gr=per*4;] or less.
  100.  
  101. Adios,
  102. Blue Death
  103.  
  104.