home *** CD-ROM | disk | FTP | other *** search
- Papa Bear #1 @11579
- Wed Jun 07 21:56:23 1995
- 0R 34 06/09 07:13 WWIVNET 4051->8421
- 0R 34 06/08 18:18 WWIVNet 4001->4051
- 0R 34 06/08 14:07 WWIVnet 4000->4001
- 0R 34 06/08 05:34 WWIVnet ->4000
- 0R 34 06/08 01:36 WWIVnet 4001->4000
- 0R 34 06/08 09:17 WWIVnet 11579->4001
- 0R 34 06/07 21:56 WWIVnet ->11579
- 4Msg. Status:3▄ 16Please reply!00
- 3 ▀▀▀▀▀▀▀▀▀▀▀▀0
-
- ┌────────────────────────────A CEREBRUM release!─────────────────────────────┐
- │ Mod Name: SPV062I.MOD Mod Authors: Pâpâ ßêâr (11579.wwivnet) │
- │ Difficulty: ▓░░░░░░░░░ First ----- [08/08/94] Captain EJ & Others │
- │ WWIV Version: 4.24 Last ------ [06/07/95] │
- │ Files Affected: MSGBASE.C BBS.C VARS.H FCNS.H │
- │ Description: A multi-mail function with a WONDERFUL multi-function //HOST │
- │command. Supports any and all of your networks! │
- ╞═────────────────────────────────────═╤═───────────────────────────────────═╡
- │ StarPort Valhalla [ ] - ASV 28.8kbps Home of the SPV mod series! │
- └─────────────────────────────────────═╧═────────────────────────────────────┘
-
- >>> OFFICIAL WWIV SUPPORT SITE! <<<
-
- Word of Warning: You installed it, you're responsible! Make back-ups BEFORE
- attempting to install this modification! Read all text before beginning.
- ─────────────────────────────────────────────────────────────────────────────
- LEGEND:
- == Original Code [use this to search on]
- ++ Add this Line [mods ALWAYS add stuff, don't they?]
- -+ Change this Line [I usually comment these lines]
- ... Skipping some code here [keeps the mod shorter]
- ─────────────────────────────────────────────────────────────────────────────
- LONG DESCRIPTION: This subboard will allow you to mass-mail people on any
- network(s) you have. *PLEASE, DO NOT ABUSE THIS MODIFICATION. MASS MAILINGS
- CAN EASILY BE ABUSED, AND COST A LOT OF PEOPLE A LOT OF MONEY! ADDITIONALLY,
- ABUSING THIS ABILITY _CAN_ RESULT IN YOUR REMOVAL FROM THE NET(S).*
- These mass-mailings are controlled by *.NMM files that you build in your
- GFILES directory. This part is accessed via //NMM
- If //HOST is entered, and number of things can happen:
- (1) If your system hosts the subboard (and this works with gated subs as
- well), you can E-Mail all the subscribers to the sub. If you do not
- select to E-Mail subscribers, you'll be offered the option to E-Mail
- the local SubOp (comes in handy if its not you).
- (2) If the subboard is hosted by another node, E-Mail will be sent to the
- hosting system.
- (3) If it is not a netted sub, E-Mail will be sent to the local host.
-
- This mod was originally NMMAIL.MOD sometime in the dark recesses of
- WWIV-dom. Captain EJ took over the project and called it CEJ-04K.MOD. Since
- he is off the net (living in Japan), I decided to fix it up for 4.24.
- I've fixed some irt problems, cleaned up code here and there, and made it
- overall, 4.24 compatible.
- ─────────────────────────────────────────────────────────────────────────────
- STEP 1: Add this line to the top of MSGBASE.C:
-
- == #define ALLOW_FULLSCREEN 1
- == #define EMAIL_STORAGE 2
- ==
- ++ static unsigned long *u_qsc; // SPV062I
- ==
- == /************************************************************************/
- == void describe_area_code(int areacode, char *description)
- ─────────────────────────────────────────────────────────────────────────────
- STEP 2: Load up MSGBASE.C, and make the following changes in void inmsg(...)
-
- == lin[i*LEN]=0;
- == ro[0]=0;
- == }
- ==
- == nl();
- == helpl=6;
- ++ title[0]=0; // SPV062I
- ++ if (mmtitle[0]) // SPV062I
- ++ strcpy(title,mmtitle); // SPV062I
- ++ if ((title[0]==0) && (needtitle)) { // SPV062I
- == if (okansi()) {
- == prt(2,get_string(1006));
- . . . SKIPPING DOWN JUST A WEE BIT! . . .
- == pl(get_string(626));
- == outstr(get_string(1006));
- == inputl(title,60);
- == }
- ++ } // SPV062I
- == if ((title[0]==0) && (needtitle)) {
- == pl(get_string(14));
- == m.stored_as=0xffffffff;
- ─────────────────────────────────────────────────────────────────────────────
- STEP 3: Now add these functions to the end of MSGBASE.C:
-
- // SPV062I START BLOCK COPY
- int find_loc_host(void)
- {
- int nu,un;
- userrec u;
-
- u_qsc=(unsigned long *)farmalloc(syscfg.qscn_len);
- un=1;
- nu=number_userrecs();
- do {
- read_user(un,&u);
- if (!(u.inact & inact_deleted)) {
- read_qscn(un,u_qsc,0);
- if ((*u_qsc!=999) && (*u_qsc==usub[cursub].subnum))
- return(un);
- }
- ++un;
- } while (un<=nu);
- nl();
- return(1);
- }
-
- typedef struct {
- unsigned short this_user,
- this_node,
- this_net;
- } address_rec;
-
- #define MAX_ADDR 200
-
- void nmmail(char *list_fn)
- {
- char s[161],s1[50],s2[81],s3[91],s4[91];
- int i,q,m,max,cc=0;
- FILE *fp;
- address_rec add[MAX_ADDR];
-
- tmp_disable_pause(1);
- i=0;
- if (!list_fn[0]) {
- nl();
- show_files("*.NMM",syscfg.gfilesdir);
- npr("5Which form letter? 0");
- mpl(8);
- input(s2,8);
- nl();
- } else
- strcpy(s2,list_fn);
- sprintf(s,"%s%s.NMM",syscfg.gfilesdir,s2);
- if (!exist(s)) {
- pl("6ERROR!! DATA FILE does not exist!!0");
- nl();
- return;
- }
- if ((fp=fsh_open(s,"rt"))<0) {
- pl("6ERROR!! Data file empty!0");
- return;
- }
- npr("5Using data file: 1%s0",s);
- nl();
- for (i=0;((!feof(fp)) & (i<MAX_ADDR));i++) {
- q=fscanf(fp,"%u@%u=%u",&add[i].this_user,&add[i].this_node,
- &add[i].this_net);
- if (q!=-1) {
- nl();
- npr("2%u3@2%u3, 2%s0",add[i].this_user,add[i].this_node,
- net_networks[add[i].this_net].name);
- }
- }
- fsh_close(fp);
- max=(i-1);
- if (max>=1) {
- nln(2);
- npr("5Total Addresses in List2: 1%i0",max);
- nln(2);
- npr("5Title2: 0");
- mpl(60);
- inputl(mmtitle,60);
- if (!mmtitle[0]) {
- return;
- }
- nl();
- npr("5Filename to import2: 0");
- mpl(50);
- input(s1,50);
- if (!s1[0]) {
- nl();
- npr("3Enter text now 5[1y5/1N5]3? 0");
- if (yn()) {
- sprintf(s1,"MULTMAIL.$$$");
- if ((okansi()) && (thisuser.defed))
- external_edit(s1,"",thisuser.defed-1,500,".",s1,1);
- }
- }
- if (!exist(s1)) {
- nl();
- npr("6ERROR! 2%s 6does not exist.0",s1);
- nln(2);
- return;
- }
- nl();
- if ((max>1) && (strcmp(s1,"MULTMAIL.$$$")==0)) {
- npr("5Append the number of E-Mails being sent? 0");
- if (yn())
- cc |= 1;
- npr("5Append actual address's? 0");
- if (yn())
- cc |= 2;
- }
- if (cc) {
- fp=fsh_open(s1,"at");
- if (cc & 1) {
- pl("4Adding number of addressee's...0");
- sprintf(s4,"\n9NetMultiMail sent to 1%d9 addresses.0\n",max);
- fprintf(fp,s4);
- }
- if (cc & 2) {
- pl("4Adding CC list...0");
- strcpy(s4,"\n5CC2: 0");
- for (m=0; m<max; m++) {
- sprintf(s3,"1%u9@1%u 3(2%s3) 0",
- add[m].this_user,add[m].this_node,
- net_networks[add[m].this_net].name);
- strncat(s4,s3,35);
- if (((m+1)%3)==0) {
- strcat(s4,"\n");
- fprintf(fp,s4);
- strcpy(s4," ");
- }
- }
- fprintf(fp,s4);
- }
- fprintf(fp,"\n");
- fsh_close(fp);
- }
- for (i=0;i<max;i++) {
- set_net_num(add[i].this_net);
- if (add[i].this_node) {
- load_workspace(s1,1);
- email(add[i].this_user,add[i].this_node,-1,0);
- }
- }
- if (strcmp(s1,"MULTMAIL.$$$")==0)
- unlink(s1);
- nl();
- mmtitle[0]=0;
- pl("6Done!!0");
- }
- tmp_disable_pause(0);
- }
- // SPV062I END BOCK COPY
-
- NOTE: If you want to be able to send mail to more than 100 addresses, then
- increase the value in this line accordingly.
- ─────────────────────────────────────────────────────────────────────────────
- STEP 4: Add this line to the top of MMENU.C
-
- == #include "ripint.h"
- == #include <ctype.h>
- ==
- ++ #include "subxtr.h" // SPV062I
- ==
- == void mainmenu(void)
- ─────────────────────────────────────────────────────────────────────────────
- STEP 5: Now, in MMENU.C, void mainmenu(void), add these variable declarations
-
- == static int mflag = 0, no_clear = 0;
- == long oldstat;
- == FILE *namefile;
- ++ int i1,i2; // SPV062I
- ++ FILE *fw,*fr; // SPV062I
- ++ xtrasubsnetrec *xnp; // SPV062I
- ==
- == s2[0]=0;
- == if (usub[cursub].subnum==-1) {
- ─────────────────────────────────────────────────────────────────────────────
- STEP 6: Still in the same file, and same function:
-
- == sysoplog(get_stringx(1,9));
- == if (incom)
- == topscreen();
- == }
- // SPV062I START BLOCK COPY
- if (strcmp(s,"NMM")==0) {
- sysoplog("@ Used NetMultiMail");
- irt[0]=irt_name[0]=0;
- nmmail("");
- }
- if (strcmp(s,"HOST")==0) {
- xnp=xsubs[usub[cursub].subnum].nets;
- sprintf(irt,"5RE2: 9Your subboard - 1%s0",
- subboards[usub[cursub].subnum].name);
- sysoplog("@ Used HOST NetMultiMail");
- nln(2);
- if ((xsubs[usub[cursub].subnum].nets[0].host) &&
- (xsubs[usub[cursub].subnum].num_nets)) {
- pl("6Searching Database, Please standby...0");
- i2=find_loc_host();
- if (i2!=1) {
- email(i2,0,0,0);
- } else {
- set_net_num(xsubs[usub[cursub].subnum].nets[0].net_num);
- sprintf(irt,"5%s 3(9Type2: 1%s3)0",
- subboards[usub[cursub].subnum].name,xnp->stype);
- email(1,xsubs[usub[cursub].subnum].nets[0].host,0,0);
- set_net_num(0);
- }
- }
- if ((!xsubs[usub[cursub].subnum].nets[0].host) &&
- (xsubs[usub[cursub].subnum].num_nets)) {
- i1=0;
- if (so()) {
- npr("5Send to subscribers? 0");
- i1=yn();
- nl();
- }
- if (i1) {
- sprintf(irt,"5%s 3(9Type2: 1%s3)0",
- subboards[usub[cursub].subnum].name,xnp->stype);
- sprintf(s1,"%sNMMAIL%2.2d.NMM",syscfg.gfilesdir,instance);
- fw=fsh_open(s1,"wt+");
- for (i=0,xnp=xsubs[usub[cursub].subnum].nets;
- i<xsubs[usub[cursub].subnum].num_nets; i++,xnp++) {
- sprintf(s1,"%sN%s.NET",net_networks[xnp->net_num].dir,
- xnp->stype);
- if (exist(s1)) {
- fr=fsh_open(s1,"rt");
- ok=1;
- do {
- fgets(s2,15,fr);
- s2[strlen(s2)-1]=0;
- if (s2[0]) {
- fprintf(fw,"1@%s=%d\n",s2,xnp->net_num);
- s2[0]=0;
- }
- } while (!feof(fr));
- fsh_close(fr);
- }
- }
- fsh_close(fw);
- topscreen();
- sprintf(s1,"NMMAIL%2.2d",instance);
- nmmail(s1);
- } else {
- pl("6Searching Database, Please standby...0");
- i2=find_loc_host();
- email(i2,0,0,0);
- }
- }
- if (!xsubs[usub[cursub].subnum].num_nets) {
- pl("6Searching Database, Please standby...0");
- i2=find_loc_host();
- email(i2,0,0,0);
- }
- irt[0]=irt_name[0]=0;
- set_net_num(0);
- }
- // SPV062I END BLOCK COPY
- == if ((strcmp(s,"CHUSER")==0) || (strcmp(s,"CU")==0)) {
- == write_inst(INST_LOC_CHUSER,0,INST_FLAGS_NONE);
- == chuser();
- == }
- ─────────────────────────────────────────────────────────────────────────────
- STEP 7: Add this to VARS.H
-
- == str_quit[20], str_yes[20], tc[81], ver_no1[51],
- == ver_no2[51],wwiv_net_no[20], xdate[9], *xenviron[50],
- -+ dlfn[81],edlfn[81], nete[5], irt_sub[81], mmtitle[81];
- // ADDED mmtitle[81]
- ==
- == __EXTRN__ unsigned char actsl, andwith, checksum;
- ─────────────────────────────────────────────────────────────────────────────
- STEP 8: Add the prototypes to FCNS.H
-
- == int existprint(unsigned char *fn);
- == void read_message(int n, int *next, int *val);
- == void lineadd(messagerec *m1, char *sx, char *aux);
- ++ int find_loc_host(void); // SPV062I
- ++ void nmmail(char *list_fn); // SPV062I
- ==
- == /* File: msgbase1.c */
- ─────────────────────────────────────────────────────────────────────────────
- STEP 9: Recompile the whole shootin' match.
- ─────────────────────────────────────────────────────────────────────────────
- STEP 10: Create any *.NMM files in the GFILES directory that you want:
-
- -- Create a file in your GFILES dir for every mailing list you want to
- create using the following format:
-
- [User Number]@[Node Number]=[Net Number]
-
- BTW the Net Number is using the number from INIT. Meaning if you have
- three nets and they are WWIVnet, WWIVlink and SEXnet (in that order
- in INIT) then they will be equal to 0,1 & 2 respectively. So if you
- wanted to email the net you would create a file like the following
- that I have called TEMP.NMM (note that what is in paranthesis does NOT
- have to be in the file!!):
-
- 1@10000=0 (Emailing #1 @10000 WWIVnet)
- 1@10300=2 (Emailing #1 @10300 SEXnet)
- 10@50801=1 (Emailing #10 @50801 WWIVlink)
- 288@52400=0 (Emailing #288 @52400 WWIVnet)
-
- NOW.... once this is done, you can email those users from the main menu
- by typing //NMM and then chosing the NMM file you want. ALSO if you are
- using the //HOST option, it will AUTOMATICALLY create the NMM file for
- you. It will NOT delete, but each time the command is run it will
- overwrite the last one (NMMAIL01.NMM for instance 1), that way you can
- use it again using the //NMM command later.
- ─────────────────────────────────────────────────────────────────────────────
- Explanation of functions -
-
- int find_loc_host(void);
-
- This function can be handy in other functions as well, it will search the
- userrec for the local host (SySu) of the current sub (cursub). It is used
- to located the SySu of a sub that is local in the //HOST command.
-
- void nmmail(char *list_fn);
-
- This function will email every user in the *.NMM list that it is passed.
- If you do not pass it a *.NMM filename (pass it a NULL or "") then it will
- prompt you for a filename from the existing ones in your GFILES dir.
- ─────────────────────────────────────────────────────────────────────────────
- This mod is copyright 1993,1994 by Tracy Baker, aka Papa Bear, and is
- distributed as freeware. Permission is granted to distribute and post this
- mod on BBS systems and online services, provided no alterations are made
- (removal of message headers/taglines allowed). This mod may contain some
- parts of WWIV source code, which is copyright 1988-1994 by Wayne Bell and
- licensed only to registered users of WWIV. Use of WWIV source without
- registration constitutes a license violation and could lead to legal
- prosecution and certain doom.
- Shareware distributors and CD-ROM publishers may not distribute this mod
- without express written permission of the Author or WWIV Software Services.
-
- 7-9=1*6>2Pâpâ ßêâr6<1*9=7-0