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 >
Wrap
Text File
|
1990-07-11
|
4KB
|
157 lines
Benny Hill #1 @7400
Fri Jul 06 01:27:02 1990
New Gfiles Highlite Mod
This mod will cause a message like:
There may be new general files available.
To be printed when a user logs on. It will also cause your file sections to
look like this....
1. Help
2. * Online Game Documentation
and ....
1. Food Fite instructions...
2. * Space Dynasty Bulletin
3. Dragon's Hoard Docs
etc...
KEY:
+ = New Lines to add
- = Existing Code
+*+ = Benny's Additions
First, block copy the following two procedures over their counterparts in
BBSUTL.C.
void list_sec(int *map, int nmap)
{
int i,abort;
char s[81];
abort=0;
pla("",&abort);
pla("",&abort);
pla("G-Files sections available:",&abort);
pla("",&abort);
for (i=0; (i<nmap) && (!abort) && (!hangup); i++) {
sprintf(s,"%2d. %s %s",i+1,(gfilesec[map[i]].daten>thisuser.daten)
? "6*0" : " ",gfilesec[map[i]].name);
^ ^
imbedded Ctrl-C's
ansic(0);
pla(s,&abort);
}
nl();
}
void list_gfiles(gfilerec *g, int nf)
{
int i,abort;
char s[81];
abort=0;
pla("",&abort);
pla("",&abort);
pla("G-Files in this section:",&abort);
pla("",&abort);
if ((nf==0) && (abort==0)) {
nl();
pl("None.");
nl();
}
for (i=0; (i<nf) && (!abort) && (!hangup); i++) {
sprintf(s,"%2d. %s %s",i+1,(g[i].daten>thisuser.daten) ? "6*0" : " ",
g[i].description); ^ ^
imbedded Ctrl-C's
ansic(0);
pla(s,&abort);
}
nl();
if ((!abort) && (cs())) {
pl("A. Add G-files");
pl("D. Delete G-files");
nl();
}
}
-------------------------------------------------------------------------
Then in void logon() add the following code ....
- batchtime=0.0;
- numbatch=0;
- strcpy(xdate,date());
+ i=0;
+ do {
+ i1=0;
+ if (thisuser.daten<gfilesec[i].daten) i1=1;
+ if (thisuser.age<gfilesec[i].age)
+ i1=0;
+ if (thisuser.sl<gfilesec[i].sl)
+ i1=0;
+ if (((thisuser.ar & gfilesec[i].ar)==0) && (gfilesec[i].ar))
+ i1=0;
+ ++i;
+ } while ((!i1)&&(numsec>i));
+ if (i1) {
+ prt(2,"There may be new General Files available"); nl();
+*+ outstr("Check 'em out? ");
+*+ if (yn())
+*+ gfiles();
+ nl();
+ }
- i1=0;
in void modify_sec(int n) add the following line....
- r=gfilesec[n];
+ time(&(r.daten));
- done=0;
Add the following two lines in function int fill_sec
- strcpy(g1.filename,s);
- strcpy(g1.description,s1);
+ time(&(g1.daten));
+ time(&(gfilesec[sn].daten));
- g[i]=g1;
- } else
- ok=0;
Finally, add the following field to structure gfiledirrec in vardec.h
- typedef struct {
- char name[41], /* g-file section name */
- filename[9]; /* g-file database filename */
- unsigned char sl, /* sl required to read */
- age; /* minimum age for section */
- unsigned short maxfiles, /* max # of files */
- ar; /* AR for g-file section */
+ long daten; /* date last gfiles added */
- } gfiledirrec;
This should not cause any problems with INIT.EXE, because it doesn't create
any gfile sections when you first run it.
Ok. Thats all folks. Just hit the trusty F9 and go watch a Cubs game while the
entire BBS recompiles. You will also have to delete the current Gfile sections
(NOT the Gfiles themselves!) and re-add them, since the record structure has
been changed, but you will not have to go thru and re-add all the gfiles
themselves, as they will still be on the disk...
[Insert your favorite Disclaimer here]