home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
SYSOP
/
MODS1.ZIP
/
666-003B.MOD
< prev
next >
Wrap
Text File
|
1993-07-26
|
21KB
|
547 lines
1[6666-003B.MOD1]2 - Super G-Files 2.00 - BEST G-file mod
``Satan`` WWIVlink #1 AT 17320
Wed Jul 21 21:59:46 1993
0R: net33: @870 (via @3469) [20:55 07/26/93]
0R: net33: @1021 (via @1040) [00:13 07/26/93]
0R: net33: @1040 (via @2050) [10:42 07/25/93]
0R: net33: @2050 [10:14 07/25/93]
0R: net33: @2050 (via @1040) [00:17 07/25/93]
0R: net33: @1040 (via @1023) [00:13 07/25/93]
0R: net33: @1023 (via @3454) [20:56 07/24/93]
0R: net33: @3454 [18:52 07/24/93]
0R: net33: @13468 (via @13900) [08:03 07/24/93]
0R: net33: @13900 (via @17313) [03:02 07/24/93]
0R: net33: @17310 (via @17320) [23:30 07/21/93]
0R: net33: @17320 [22:02 07/21/93]
─────────────────────────────────────────────────────────────────────────────
.° 666-003B.MOD °.
∙ Super G-Files 2.00 ∙
°∙. The Best G-File Section You Could _Possibly_ Have! .∙°
By Satan, WWIVlink #1 @17320, WWIVnet #1 @7326
lipinski@csugrad.cs.vt.edu
Sysop: On Earth As It Is In Hell, Virginia Tech (703) 2-2592
telnet vtcbx.cc.vt.edu and type "C 22592"
─────────────────────────────────────────────────────────────────────────────
The G-Files have been one of the most-ignored features in WWIV. This is
because they very hard to manage, and they are simply not too interesting
to a user because it is very time-consuming and a user cannot DOWNLOAD the
G-Files. This modification changes everything. It also makes your GFILES.C
about 5 times bigger.
This mod represents days of my work. I think I can safely say that this is
the best G-Files mod that exists. I am hoping that some of this code gets
to Wayne Bell and that he uses some of it in stock WWIV 4.23 or 4.24.
Enough talk...
MAJOR FEATURES (ones with "■" by them are ones *NOT* fully credited to)
────────────── (ones with "█" by them are new for version 2.00)
■ DOWNLOADable G-File sections (ZIPs it beforehand)
■ SEARCH a specific G-File for specific text
█ Can quickly MOVE G-Files from one section to another w/o re-typing descript.
█ One-Key PURGING of any invalid G-File entries ("File Not Found" G-Files)
█ Can REDESCRIBE (Rename) G-Files without having to delete and then add
NEW G-FILE SCAN after scanning messages / files
Each G-File section can optionally have its own BULLITEN
Search a G-File SECTION for specific text
G-File section itself can have a bulliten
█ Individual cosysop access flags for G-File Moving, Adding, Global-Adding,
Deleting, Renaming, and Purging
NOT-AS-MAJOR FEATURES
─────────────────────
When G-Files are downloaded, an SSM is sent to the sysop
■ When G-Files are downloaded, it is put into the //LOG
Color allowed for G-File Descriptions
Color allowed for G-File SECTION Descriptions
Support added for keeping color AND STILL lining up filenames in GFLEDIT
█ Support added for clearing the rest of the line in an efficient way (now
done with the clear_to_eol ansi code instead of just outputting a buncha
spaces, and also works with any screen width)
█ Support added for keeping colors in context, for example if a subname was
Really 6GROSS 0Stuff, the question for download would look like:
5Download Really 6GROSS 5Stuff?
instead of
5Download Really 6GROSS 0Stuff?
Support added for converting inputs to color inputs, and other color support
G-File Section checking done efficiently (if the .GFL file's dos date is not
greater than the N-Scan date, the section will not be checked, as this is
unnecesary) (patterned after the file scan mod that does the same)
█ Can ABORT the G-File Scan
█ If G-File Scan is aborted, user is notified of abortion
█ 'X' & 'S' commands are displayed for normal users (forgot in old versions)
█ The 'A' main-Gfiles command is displayed for those who didn't know it existed
█ Can abort G-File searches
█ Searches no longer pause and clear the screen between each file
EASE-OF-INSTALLATION FEATURES
─────────────────────────────
█ Multiline #define (allows users of Arc Angel's Multi-Line mod to be able to
add this without any kind of modification)
█ Old_pausescr #define (allows users of 666-004.MOD who have a void
old_pausescr to be able to utilize old_pausescr if so desired)
█ Define's for standard colors so if you have stock WWIV, you can compile w/o
fear
█ Define's for extended colors so you don't have to search through and change
█ Define's for context_prt (very minor, since I included it in the mod)
█ Use of tacky inli2 function no longer necesary (actually, it never was)
OTHER MODS PUT IN HERE VERY EASILY
──────────────────────────────────
█ Documented in code. Read all comments.
A NOTE ON VERSION NUMBERS
─────────────────────────
I use 4.22 Multiline. However, if you are only running 4.21(a) or
even (maybe) 4.12, there shouldn't be too many problems with running
this mod. Just replace the "get_string(x)" statements with the
original string that you have in your source. If you need a list
of what they all are, email me. I attempted to place some as
comments next to the get_string call for a bit of help.
A NOTE ON WARNINGS
──────────────────
Warnings GOOD. Me like warnings. 5 warnings in function find (gfiles.c).
Me not worry; You no worry either or _ME BASH_!
NON-PROGRAMMING STUFF YOU'LL NEED TO [OPTIONALLY] DO:
─────────────────────────────────────────────────────
G-File Section Bullitens: If your G-File "Filename" (Directory
Name) is GENERAL, then you may optionally create a file called
GENERAL.NFO that will be displayed upon a user entering the General
G-File Section. This is good for disclaimers (x-rated sections)
and requests for text-files. By the same token, "GFILE.MSG" is
the name of the bulliten (if any) to be displayed upon entering
the G-Files at all. You might want GFILE.MSG to post a bulliten
of wanted G-Files.
INHERENT MODS? (What a novel concept)
──────────────
Yes, many. With some simple replacements, a sysop could colorize
EVERYTHING IN THE BOARD, almost literally.
Basically, if you want to very simply make EVERY lower-case input
that *EXISTS* in the board to a color input, replace the one line
in function inputl (this is in com.c) with this line:
inli(s,"",len,1);
If you want to allow color on an individual basis, change any inputl
statements like this:
inputl(s3,23); /* change this */
inli(s3,"",23,1); /* to this */
This works for message titles as well.
CREDITS
───────
1 @15101 (?) - Individual G-File Searching Mod (didn't do sections)
WafWot #2 @2632 - G-File Download Mod (WAF017.MOD)
Archangel (410-732-2501) - MultiLine Mod (call & leech BOTH auto-inst mods)
and file_copy/supporting functions used in my mod
Midnight Tree Bandit #1 @18411 - Message Extraction to G-File Mod
Anybody I missed - Don't hesitate to E-Mail me
Special thanks to Bill The Cat #1 @17321 WWIVLink/1@1 FearNet for Beta-Testing
QUICK COMMENTARY
────────────────
You may have noticed I do not have uploading included here. First
off, I'm not THAT good (well, I am, but I'm not that AMBITIOUS...
Yeah... that's the ticket...<grin>). Second off, I don't think a
G-File section should have uploading. A G-File section to me is a
sysop-maintained text file archive, basically allowing you to preview
a file while online and/or download at your leisure.
Also, note that if you REALLY want a g-file to appear first, you can
just do something like put a ^P0^P0 before it... Since ^P is represented
as ^C, that SHOULD be the lowest character you can INPUT into the description,
and thus should gaurantee the file being at the beginning of the section. If
you DON'T like this, comment out the #define SORT_USES_COLORS in GFLEDIT.C,
and make sure you have Tokien's strip_wwiv function (I have it if you want it).
─────────────────────────────────────────────────────────────────────────────
STEP 1 ── GFILES.C ─- *** REPLACE YOUR WHOLE GFILES.C WITH THIS: ***
─────────────────────────────────────────────────────────────────────────────
Make sure you take a look at the GFILES.C - there are some #defines
that you may need to recon with. (most of you will probabaly want
to comment out the #define MULTILINE, for example, but it MAY be
compatible with 4.23 (can't think of why it wouldn't), so you can
simply re-#define it when you upgrade and try to use this mod again.)
[***GFILES.C IS THE NEXT POST***]
─────────────────────────────────────────────────────────────────────────────
STEP 2 ─- MSGBASE1.C ─- Improvements to N-Scan and Extract-A-Msg
─────────────────────────────────────────────────────────────────────────────
Either replace this, or modify it accordingly:
void nscan(int ss)
{
int i,nextsub,abort,next;
nl();
nextsub=1;
prt(3,get_string(695));
nl();
for (i=ss;(usub[i].subnum!=-1) && (i<num_subs) && (nextsub) &&
(!hangup);i++){
if (qsc_q[usub[i].subnum/32]&(1L<<(usub[i].subnum%32)))
qscan(i,&nextsub);
abort=next=0;
checka(&abort,&next);
if (abort)
nextsub=0;
}
nl();
prt(3,get_string(696));
nl();
nl();
/* Most users don't finish their q-scan; I decided it's better to
show them the new files and G-files even if they quit...
if ((nextsub) && (thisuser.sysstatus & sysstatus_nscan_file_system) && */
if ((thisuser.sysstatus & sysstatus_nscan_file_system) &&
((syscfg.sysconfig & sysconfig_no_xfer)==0)) {
nl();
prt(3,"<< Scanning For New Files >>"); nl();
nl();
nscanall();
nl(); nl();
prt(3,"<< Global New-File Scan Done >>"); nl();
}
nl(); nl();
gfilescan();
pausescr(); //may want to remove this line depending on your bbs
}
/* Special note: I worked quite a long time just to get the cosmetic
nl();'s to be uniform with all 3 scans */
Now, replace void extract_out with my modified version of Midnight Tree
Bandit's MTBEXTR2.MOD:
#define MULTILINE /* AGAIN take out if you aren't multiline */
void extract_out(char *b, long len, char *title) {
char s1[81],s2[81],s3[81],ch=26,ch1; /* added s3[81] */
int i,n; /* added n */
gfiledirrec r;
do {
prt(7,">>> ");prt(9,"Available G-File Directories");prt(7," <<<");
nl();nl();
for (i=0; i<num_sec; i++) {
r=gfilesec[i];
sprintf(s1,"[%d] - %s",i,r.name);
pl(s1);
}
nl(); prt(2,"Save to which Gfile Directory?" ); nl();
prt(2,"<Enter> to Abort : ");
input(s3,2);
if ((s3[0]) && (strcmp(s3,"0")!=0)) {
n=atoi(s3);
if ((n<=0) || (n>=i)) {
npr("1%s3 is not a valid GFiles directory number.",s3);
s3[0]=0;
}
}
if (s3[0]) {
n=atoi(s3);
r=gfilesec[n];
sprintf(s3,"%s",r.filename); nl();
prt(2,"Save under what filename? ");
mpl(12);
input(s1,12);
if (s1[0]) {
sprintf(s2,"%s%s\\%s",syscfg.gfilesdir,s3,s1); /* added in s3 */
if (exist(s2)) {
nl(); pl("Filename already in use."); nl();
prt(2,"O)verwrite, A)ppend, N)ew name, Q)uit? ");
ch1=onek("QOAN");
switch(ch1) {
case 'Q': s3[0]=0; s2[0]=0; s1[0]=0; break;
case 'N': s1[0]=0; break;
case 'A': break;
case 'O': unlink(s2); break;
}
nl();
}
} else s2[0]=0;
} else s3[0]=0;
} while ((!hangup) && (s2[0]!=0) && (s1[0]==0) && (s3[0]!=0));
if ((s1[0]) && (s3[0]) && (!hangup)) {
#ifdef MULTILINE
i=open_w(s2,0);
#else
i=open(s2,O_RDWR | O_BINARY | O_CREAT , S_IREAD | S_IWRITE);
#endif
if (filelength(i)) {
lseek(i, -1L, SEEK_END);
read(i, ((void *)&ch1), 1);
if (ch1 == 26)
lseek(i, -1L, SEEK_END);
}
write(i,title,strlen(title));
write(i,"\r\n",2);
write(i,(void *)b,len);
write(i,&ch,1);
close(i);
npr("Message written to: %s.\r\n",s2);
ansic(2); npr("Please describe %s:",s2); nl();
inli(s2,"",60,1);
if (s2[0]) {
fill_sec(n,s1,s2);
} else
prt(2,"File not described!");
} else {
nl(); prt(6,"Aborted!"); nl();
}
farfree(b);
}
─────────────────────────────────────────────────────────────────────────────
STEP 3 ─- BBS.C ─- Add a /G command to scan new G-Files
─────────────────────────────────────────────────────────────────────────────
Search for if (strcmp(s,"/E")==0) and add this right below:
if (strcmp(s,"/G")==0) { //ADD-666
nl();
prt(3,"Use T and then P to change your G-File Scan date."); nl();
nl();
gfilescan(); //ADD-666
} //ADD-666
■ Update your menus! ■ (The fun never ends!!)
─────────────────────────────────────────────────────────────────────────────
STEP 4 ─- GFLEDIT.C ─- REPLACE all of these functions, also watch #defines
─────────────────────────────────────────────────────────────────────────────
#define MULTILINE /* Again, COMMENT THIS OUT if you are not multiline */
#define SORT_USES_COLORS /* See Documentation. Erasing this line causes the
* BBS to ignore color codes when adding files. This
* will keep the sort a bit less "truely" alphabetic
* but will also allow you to insert a ^P0^P0 at the
* beginning of a file to guarentee it showing up
* FIRST in the G-File section. Note that IF YOU
* ERASE THIS SORT, YOU MUST HAVE TOKIEN'S
* strip_wwiv FUNCTION!!!!! */
int fill_sec(int sn, char *filename, char *description)
/*
* Note that the call to the function has been changed. It was only called
* from 2 different places anyways...
*
* Normal calls would be fill_sec(sn,"",""), but if a file name is KNOWN,
* and a description is known as well (the case of moving files), these
* parameters can be sent in like fill_sec(sn,"voting.txt","Voting Results");
*/
{
gfilerec *g,g1;
int f1,nf,ok,i,i1,i2,chd;
char s[81],s1[81],s3[81],s4[81],s5[81];
struct ffblk ff;
g=read_sec(sn,&nf);
if (strcmp(filename,"")==0)
sprintf(s1,"%s%s\\*.*",syscfg.gfilesdir,gfilesec[sn].filename);
else
sprintf(s1,"%s%s\\%s",syscfg.gfilesdir,gfilesec[sn].filename,filename);
f1=findfirst(s1,&ff,0);
ok=1;
chd=0;
while ((f1==0) && (!hangup) && (nf<gfilesec[sn].maxfiles) && (ok)) {
strcpy(s,(ff.ff_name));
align(s);
i=1;
for (i1=0; i1<nf; i1++)
if (compare(s,g[i1].filename))
i=0;
if (i) {
if (strcmp(description,"")==0) {
ansic(0);
npr("%s : ",s);
/* inputl(s1,60); Non-Color Input */
inli(s1,"",60,1);
} else
strcpy(s1,description);
if (!s1[0]) {
prt(5,"View file? ");
if (ny()) {
sprintf(s3,"%s\\%s",gfilesec[sn].filename,ff.ff_name);
if (strstr(s3,".")==NULL) {
sprintf(s4,"%s%s\\%s",syscfg.gfilesdir,gfilesec[sn].filename,
ff.ff_name);
sprintf(s5,"%s%s\\%s.TXT",syscfg.gfilesdir,gfilesec[sn].filename,
ff.ff_name);
file_copy(s4,s5);
unlink(s4); /* renames file since printfile wont */
sprintf(s5,"%s\\%s.TXT",gfilesec[sn].filename,ff.ff_name);
printfile(s5); /* print of files with no extension. */
sprintf(s,"%s.TXT",ff.ff_name);
align(s); /* I wouldn't do this if */
prt(3,"Extension .TXT auto-added."); /* it wasn't NECESSARY */
nl();
} else printfile(s3);
} else ok=0;
if (ok) {
npr("%s : ",s);
inli(s1,"",60,1);
}
}
if ((s1[0]) && (ok)) {
chd=1;
i=0;
#ifdef SORT_USES_COLORS
while ((strcmp(s1,g[i].description)>0) && (i<nf))
#else
while ((strcmp(s1,strip_wwiv(g[i].description))>0) && (i<nf))
#endif
++i;
for (i1=nf; i1>i; i1--)
g[i1]=g[i1-1];
++nf;
strcpy(g1.filename,s);
strcpy(g1.description,s1);
time(&(g1.daten));
g[i]=g1;
} else {
if (ok) {
prt(5,"File not described. Continue anyway? ");
if (!yn())
ok=0;
else
ok=1;
}
}
}
f1=findnext(&ff);
}
if (!ok)
pl(get_string(14)); /* "Aborted." */
if (nf>=gfilesec[sn].maxfiles)
pl(get_string(88)); /* "Section full." */
if (chd) {
sprintf(s,"%s%s.GFL",syscfg.datadir,gfilesec[sn].filename);
#ifdef MULTILINE
i=open_w(s,O_CREAT | O_TRUNC);
#else
i=open(s,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
#endif
write(i,(void *)g,nf*sizeof(gfilerec));
close(i);
}
farfree(g);
return(!ok);
}
void gfiledata(int n, char *s)
{
char x,y,k,i;
gfiledirrec r;
r=gfilesec[n];
if (r.ar==0)
x=32;
else {
for (i=0; i<16; i++)
if ((1 << i) & r.ar)
x='A'+i;
} /* v- Might want to add a heart-0 combo */
sprintf(s,"%2d %1c %-40s%s %-8s %-3d %-3d %-3d", /* changed-666 */
n,x,r.name,extra_spaces(r.name),r.filename,r.sl,r.age,r.maxfiles);
/* changed-666 */
}
Note to color-maniacs:
Note that you can use that convention for ANYTHING color related.
Simply add the %s after it, along with the extra spaces. For you
color maniacs, I have color voting (limit still 80 characters
though, including color changes), color oneliners, color rumours
(for these 2, it's still 80 columns, but as many color changes as
you want), color-all-sub/file/gfile/chain-names, and color
title-scanning-in-boxes. I have some other support procedures
(like a first that will print out the first x chars of a certain
string regardless of color changes, kind of a bear to write), just
email me at my address if you want something.
─────────────────────────────────────────────────────────────────────────────
STEP 5 ─- FCNS.H ─- Add our new functions. Then kill them with spikes.
─────────────────────────────────────────────────────────────────────────────
/* File: gfiles.c */ /* Replace ALL of this section with these: */
void gfilescan(void);
void scangfilesec(int d, int *abort, int *any_listed);
void purge_sec(int sn, int *num_purged);
void list_gfiles(gfilerec *g, int nf);
void gfile_sec(int sn, int *map, int nmap);
void gfiles(void);
int find (char *f1,char *s,int *totalfound,int *abort,int *next);
char *get_file(char *fn, long *len);
gfilerec *read_sec(int sn, int *nf);
void list_sec(int *map, int nmap);
/* Support functions: ONLY put in gfiles.c for ease of installation */
char *extra_spaces(char *instr);
void context_prt(int color, char *s);
void outchrs(char c, int i);
void nl2(void);
void clear_rest_of_line(void);
/* If you are using Arc Angel's Multiline Mod, don't use these 3 functions: */
int file_copy(char *oldfilename, char *newfilename);
int open_r(char *s);
int open_w(char * s, int access);
/* File: gfledit.c */ /* Modify the fill_sec declaration */
int fill_sec(int sn, char *filename, char *description); //666-Modify
─────────────────────────────────────────────────────────────────────────────
You're Finished!
COMPILE, YOU FAT BLOATED SACK OF PROTOPLASM! (Must I tell you
EVERYTHING?)
Have Fun with your new-and-improved G-File section, and e-mail any questions
to me, pref WWIVLink E-mail. Use Internet mail for speed.
-Satan
─────────────────────────────────────────────────────────────────────────────
Note: If you even LOGGED this, please hit 'a' and email me to
boost my ego. Email me twice if you consider using it, 3 times if
you put it up for download, and no less than 42 times if you use
it. For your thank you e-mail, describe a good experience that you
have had while eating bananas.
─────────────────────────────────────────────────────────────────────────────