home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / MODSUNKN.ZIP / NEWGFILE.MOD < prev    next >
Text File  |  1990-07-11  |  4KB  |  157 lines

  1. Benny Hill #1 @7400
  2. Fri Jul 06 01:27:02 1990
  3. New Gfiles Highlite Mod
  4.  
  5.  
  6. This mod will cause a message like:
  7.  
  8. There may be new general files available.
  9.  
  10. To be printed when a user logs on. It will also cause your file sections to
  11. look like this....
  12.  
  13. 1.   Help
  14. 2. * Online Game Documentation
  15.  
  16. and ....
  17.  
  18. 1.   Food Fite instructions...
  19. 2. * Space Dynasty Bulletin
  20. 3.   Dragon's Hoard Docs
  21.  
  22. etc...
  23.  
  24.  
  25. KEY:
  26.  
  27. +    =  New Lines to add
  28. -    =  Existing Code
  29. +*+  =  Benny's Additions
  30.  
  31.  
  32.  
  33. First, block copy the following two procedures over their counterparts in
  34. BBSUTL.C.
  35.  
  36.  
  37. void list_sec(int *map, int nmap)
  38. {
  39.   int i,abort;
  40.   char s[81];
  41.  
  42.   abort=0;
  43.   pla("",&abort);
  44.   pla("",&abort);
  45.   pla("G-Files sections available:",&abort);
  46.   pla("",&abort);
  47.   for (i=0; (i<nmap) && (!abort) && (!hangup); i++) {
  48.     sprintf(s,"%2d. %s %s",i+1,(gfilesec[map[i]].daten>thisuser.daten)
  49.             ? "6*0" : " ",gfilesec[map[i]].name);
  50.                ^  ^
  51.             imbedded Ctrl-C's
  52.  
  53.     ansic(0);
  54.     pla(s,&abort);
  55.   }
  56.   nl();
  57. }
  58.  
  59. void list_gfiles(gfilerec *g, int nf)
  60. {
  61.   int i,abort;
  62.   char s[81];
  63.  
  64.   abort=0;
  65.   pla("",&abort);
  66.   pla("",&abort);
  67.   pla("G-Files in this section:",&abort);
  68.   pla("",&abort);
  69.   if ((nf==0) && (abort==0)) {
  70.     nl();
  71.     pl("None.");
  72.     nl();
  73.   }
  74.   for (i=0; (i<nf) && (!abort) && (!hangup); i++) {
  75.     sprintf(s,"%2d. %s %s",i+1,(g[i].daten>thisuser.daten) ? "6*0" : " ",
  76.             g[i].description);                                ^  ^
  77.                                                        imbedded Ctrl-C's
  78.  
  79.     ansic(0);
  80.     pla(s,&abort);
  81.   }
  82.   nl();
  83.   if ((!abort) && (cs())) {
  84.     pl("A. Add G-files");
  85.     pl("D. Delete G-files");
  86.     nl();
  87.   }
  88. }
  89.  
  90. -------------------------------------------------------------------------
  91.  
  92. Then in void logon() add the following code ....
  93.  
  94. -  batchtime=0.0;
  95. -  numbatch=0;
  96. -  strcpy(xdate,date());
  97. +  i=0;
  98. +  do {
  99. +    i1=0;
  100. +    if (thisuser.daten<gfilesec[i].daten) i1=1;
  101. +    if (thisuser.age<gfilesec[i].age)
  102. +      i1=0;
  103. +    if (thisuser.sl<gfilesec[i].sl)
  104. +      i1=0;
  105. +    if (((thisuser.ar & gfilesec[i].ar)==0) && (gfilesec[i].ar))
  106. +      i1=0;
  107. +    ++i;
  108. +  } while ((!i1)&&(numsec>i));
  109. +  if (i1) {
  110. +    prt(2,"There may be new General Files available"); nl();
  111. +*+  outstr("Check 'em out? ");
  112. +*+  if (yn())
  113. +*+    gfiles();
  114. +    nl();
  115. +  }
  116. -  i1=0;
  117.  
  118. in void modify_sec(int n) add the following line....
  119.  
  120. -  r=gfilesec[n];
  121. +  time(&(r.daten));
  122. -  done=0;
  123.  
  124. Add the following two lines in function  int fill_sec
  125.  
  126. -          strcpy(g1.filename,s);
  127. -          strcpy(g1.description,s1);
  128. +          time(&(g1.daten));
  129. +          time(&(gfilesec[sn].daten));
  130. -          g[i]=g1;
  131. -        } else
  132. -          ok=0;
  133.  
  134. Finally, add the following field to structure gfiledirrec in vardec.h
  135.  
  136. - typedef struct {
  137. -   char    name[41],    /* g-file section name */
  138. -       filename[9];    /* g-file database filename */
  139. -   unsigned char  sl,      /* sl required to read */
  140. -       age;      /* minimum age for section */
  141. -   unsigned short  maxfiles,    /* max # of files */
  142. -       ar;      /* AR for g-file section */
  143. +   long  daten; /* date last gfiles added */
  144. - } gfiledirrec;
  145.  
  146. This should not cause any problems with INIT.EXE, because it doesn't create
  147. any gfile sections when you first run it.
  148.  
  149. Ok. Thats all folks. Just hit the trusty F9 and go watch a Cubs game while the
  150. entire BBS recompiles. You will also have to delete the current Gfile sections
  151. (NOT the Gfiles themselves!) and re-add them, since the record structure has
  152. been changed, but you will not have to go thru and re-add all the gfiles
  153. themselves, as they will still be on the disk...
  154.  
  155. [Insert your favorite Disclaimer here]
  156.  
  157.