home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / MODS / ALLMODS.ZIP / SPV062I.ZIP / SPV062I.MOD < prev   
Encoding:
Text File  |  1995-06-09  |  15.6 KB  |  428 lines

  1. Papa Bear #1 @11579
  2. Wed Jun 07 21:56:23 1995
  3. 0R 34 06/09 07:13 WWIVNET 4051->8421
  4. 0R 34 06/08 18:18 WWIVNet 4001->4051
  5. 0R 34 06/08 14:07 WWIVnet 4000->4001
  6. 0R 34 06/08 05:34 WWIVnet ->4000
  7. 0R 34 06/08 01:36 WWIVnet 4001->4000
  8. 0R 34 06/08 09:17 WWIVnet 11579->4001
  9. 0R 34 06/07 21:56 WWIVnet ->11579
  10. 4Msg. Status:3▄ 16Please reply!00
  11. 3 ▀▀▀▀▀▀▀▀▀▀▀▀0
  12.  
  13. ┌────────────────────────────A CEREBRUM release!─────────────────────────────┐
  14. │ Mod Name: SPV062I.MOD      Mod Authors: Pâpâ ßêâr (11579.wwivnet)          │
  15. │ Difficulty: ▓░░░░░░░░░     First ----- [08/08/94]   Captain EJ & Others    │
  16. │ WWIV Version: 4.24         Last ------ [06/07/95]                          │
  17. │ Files Affected: MSGBASE.C BBS.C VARS.H FCNS.H                              │
  18. │ Description: A multi-mail function with a WONDERFUL multi-function //HOST  │
  19. │command.  Supports any and all of your networks!                            │
  20. ╞═────────────────────────────────────═╤═───────────────────────────────────═╡
  21. │ StarPort Valhalla [   ]   -     ASV 28.8kbps  Home of the SPV mod series!  │
  22. └─────────────────────────────────────═╧═────────────────────────────────────┘
  23.  
  24.                      >>> OFFICIAL WWIV SUPPORT SITE! <<<
  25.  
  26.  Word of Warning:  You installed it, you're responsible! Make back-ups BEFORE
  27.  attempting to install this modification!  Read all text before beginning.
  28. ─────────────────────────────────────────────────────────────────────────────
  29.  LEGEND:
  30.  ==  Original Code [use this to search on]
  31.  ++  Add this Line [mods ALWAYS add stuff, don't they?]
  32.  -+  Change this Line [I usually comment these lines]
  33.  ... Skipping some code here [keeps the mod shorter]
  34. ─────────────────────────────────────────────────────────────────────────────
  35.  LONG DESCRIPTION:  This subboard will allow you to mass-mail people on any
  36. network(s) you have.  *PLEASE, DO NOT ABUSE THIS MODIFICATION.  MASS MAILINGS
  37. CAN EASILY BE ABUSED, AND COST A LOT OF PEOPLE A LOT OF MONEY!  ADDITIONALLY,
  38. ABUSING THIS ABILITY _CAN_ RESULT IN YOUR REMOVAL FROM THE NET(S).*
  39.  These mass-mailings are controlled by *.NMM files that you build in your
  40. GFILES directory.  This part is accessed via //NMM
  41.  If //HOST is entered, and number of things can happen:
  42.    (1) If your system hosts the subboard (and this works with gated subs as
  43.        well), you can E-Mail all the subscribers to the sub.  If you do not
  44.        select to E-Mail subscribers, you'll be offered the option to E-Mail
  45.        the local SubOp (comes in handy if its not you).
  46.    (2) If the subboard is hosted by another node, E-Mail will be sent to the
  47.        hosting system.
  48.    (3) If it is not a netted sub, E-Mail will be sent to the local host.
  49.  
  50.   This mod was originally NMMAIL.MOD sometime in the dark recesses of
  51. WWIV-dom.  Captain EJ took over the project and called it CEJ-04K.MOD.  Since
  52. he is off the net (living in Japan), I decided to fix it up for 4.24.
  53.   I've fixed some irt problems, cleaned up code here and there, and made it
  54. overall, 4.24 compatible.
  55. ─────────────────────────────────────────────────────────────────────────────
  56. STEP 1: Add this line to the top of MSGBASE.C:
  57.  
  58. == #define ALLOW_FULLSCREEN 1
  59. == #define EMAIL_STORAGE 2
  60. ==
  61. ++ static unsigned long *u_qsc;                                    // SPV062I
  62. ==
  63. == /************************************************************************/
  64. == void describe_area_code(int areacode, char *description)
  65. ─────────────────────────────────────────────────────────────────────────────
  66. STEP 2: Load up MSGBASE.C, and make the following changes in void inmsg(...)
  67.  
  68. ==      lin[i*LEN]=0;
  69. ==    ro[0]=0;
  70. ==  }
  71. ==
  72. ==  nl();
  73. ==  helpl=6;
  74. ++  title[0]=0;                                                    // SPV062I
  75. ++  if (mmtitle[0])                                                // SPV062I
  76. ++    strcpy(title,mmtitle);                                       // SPV062I
  77. ++  if ((title[0]==0) && (needtitle)) {                            // SPV062I
  78. ==    if (okansi()) {
  79. ==      prt(2,get_string(1006));
  80. . . . SKIPPING DOWN JUST A WEE BIT! . . .
  81. ==      pl(get_string(626));
  82. ==      outstr(get_string(1006));
  83. ==      inputl(title,60);
  84. ==    }
  85. ++  }                                                              // SPV062I
  86. ==  if ((title[0]==0) && (needtitle)) {
  87. ==    pl(get_string(14));
  88. ==    m.stored_as=0xffffffff;
  89. ─────────────────────────────────────────────────────────────────────────────
  90. STEP 3:  Now add these functions to the end of MSGBASE.C:
  91.  
  92. // SPV062I START BLOCK COPY
  93. int find_loc_host(void)
  94. {
  95.   int nu,un;
  96.   userrec u;
  97.  
  98.   u_qsc=(unsigned long *)farmalloc(syscfg.qscn_len);
  99.   un=1;
  100.   nu=number_userrecs();
  101.   do {
  102.     read_user(un,&u);
  103.     if (!(u.inact & inact_deleted)) {
  104.       read_qscn(un,u_qsc,0);
  105.       if ((*u_qsc!=999) && (*u_qsc==usub[cursub].subnum))
  106.         return(un);
  107.     }
  108.     ++un;
  109.   } while (un<=nu);
  110.   nl();
  111.   return(1);
  112. }
  113.  
  114. typedef struct {
  115.     unsigned short this_user,
  116.                    this_node,
  117.                    this_net;
  118. } address_rec;
  119.  
  120. #define MAX_ADDR 200
  121.  
  122. void nmmail(char *list_fn)
  123. {
  124.   char s[161],s1[50],s2[81],s3[91],s4[91];
  125.   int i,q,m,max,cc=0;
  126.   FILE *fp;
  127.   address_rec add[MAX_ADDR];
  128.  
  129.   tmp_disable_pause(1);
  130.   i=0;
  131.   if (!list_fn[0]) {
  132.     nl();
  133.     show_files("*.NMM",syscfg.gfilesdir);
  134.     npr("5Which form letter? 0");
  135.     mpl(8);
  136.     input(s2,8);
  137.     nl();
  138.   } else
  139.     strcpy(s2,list_fn);
  140.   sprintf(s,"%s%s.NMM",syscfg.gfilesdir,s2);
  141.   if (!exist(s)) {
  142.     pl("6ERROR!! DATA FILE does not exist!!0");
  143.     nl();
  144.     return;
  145.   }
  146.   if ((fp=fsh_open(s,"rt"))<0) {
  147.     pl("6ERROR!! Data file empty!0");
  148.     return;
  149.   }
  150.   npr("5Using data file: 1%s0",s);
  151.   nl();
  152.   for (i=0;((!feof(fp)) & (i<MAX_ADDR));i++) {
  153.     q=fscanf(fp,"%u@%u=%u",&add[i].this_user,&add[i].this_node,
  154.                 &add[i].this_net);
  155.     if (q!=-1) {
  156.       nl();
  157.       npr("2%u3@2%u3, 2%s0",add[i].this_user,add[i].this_node,
  158.         net_networks[add[i].this_net].name);
  159.     }
  160.   }
  161.   fsh_close(fp);
  162.   max=(i-1);
  163.   if (max>=1) {
  164.     nln(2);
  165.     npr("5Total Addresses in List2: 1%i0",max);
  166.     nln(2);
  167.     npr("5Title2: 0");
  168.     mpl(60);
  169.     inputl(mmtitle,60);
  170.     if (!mmtitle[0]) {
  171.       return;
  172.     }
  173.     nl();
  174.     npr("5Filename to import2: 0");
  175.     mpl(50);
  176.     input(s1,50);
  177.     if (!s1[0]) {
  178.       nl();
  179.       npr("3Enter text now 5[1y5/1N5]3? 0");
  180.       if (yn()) {
  181.         sprintf(s1,"MULTMAIL.$$$");
  182.         if ((okansi()) && (thisuser.defed))
  183.           external_edit(s1,"",thisuser.defed-1,500,".",s1,1);
  184.       }
  185.     }
  186.     if (!exist(s1)) {
  187.       nl();
  188.       npr("6ERROR! 2%s 6does not exist.0",s1);
  189.       nln(2);
  190.       return;
  191.     }
  192.     nl();
  193.     if ((max>1) && (strcmp(s1,"MULTMAIL.$$$")==0)) {
  194.       npr("5Append the number of E-Mails being sent? 0");
  195.       if (yn())
  196.         cc |= 1;
  197.       npr("5Append actual address's? 0");
  198.       if (yn())
  199.         cc |= 2;
  200.     }
  201.     if (cc) {
  202.       fp=fsh_open(s1,"at");
  203.       if (cc & 1) {
  204.         pl("4Adding number of addressee's...0");
  205.         sprintf(s4,"\n9NetMultiMail sent to 1%d9 addresses.0\n",max);
  206.         fprintf(fp,s4);
  207.       }
  208.       if (cc & 2) {
  209.         pl("4Adding CC list...0");
  210.         strcpy(s4,"\n5CC2: 0");
  211.         for (m=0; m<max; m++) {
  212.           sprintf(s3,"1%u9@1%u 3(2%s3)                    0",
  213.              add[m].this_user,add[m].this_node,
  214.              net_networks[add[m].this_net].name);
  215.           strncat(s4,s3,35);
  216.           if (((m+1)%3)==0)  {
  217.             strcat(s4,"\n");
  218.             fprintf(fp,s4);
  219.             strcpy(s4,"    ");
  220.           }
  221.         }
  222.         fprintf(fp,s4);
  223.       }
  224.       fprintf(fp,"\n");
  225.       fsh_close(fp);
  226.     }
  227.     for (i=0;i<max;i++) {
  228.       set_net_num(add[i].this_net);
  229.       if (add[i].this_node) {
  230.         load_workspace(s1,1);
  231.         email(add[i].this_user,add[i].this_node,-1,0);
  232.       }
  233.     }
  234.     if (strcmp(s1,"MULTMAIL.$$$")==0)
  235.       unlink(s1);
  236.     nl();
  237.     mmtitle[0]=0;
  238.     pl("6Done!!0");
  239.   }
  240.   tmp_disable_pause(0);
  241. }
  242. // SPV062I END BOCK COPY
  243.  
  244. NOTE: If you want to be able to send mail to more than 100 addresses, then
  245.       increase the value in this line accordingly.
  246. ─────────────────────────────────────────────────────────────────────────────
  247. STEP 4: Add this line to the top of MMENU.C
  248.  
  249. == #include "ripint.h"
  250. == #include <ctype.h>
  251. ==
  252. ++ #include "subxtr.h"                                             // SPV062I
  253. ==
  254. == void mainmenu(void)
  255. ─────────────────────────────────────────────────────────────────────────────
  256. STEP 5: Now, in MMENU.C, void mainmenu(void), add these variable declarations
  257.  
  258. ==  static int mflag = 0, no_clear = 0;
  259. ==  long oldstat;
  260. ==  FILE *namefile;
  261. ++  int i1,i2;                                                     // SPV062I
  262. ++  FILE *fw,*fr;                                                  // SPV062I
  263. ++  xtrasubsnetrec *xnp;                                           // SPV062I
  264. ==
  265. ==  s2[0]=0;
  266. ==  if (usub[cursub].subnum==-1) {
  267. ─────────────────────────────────────────────────────────────────────────────
  268. STEP 6: Still in the same file, and same function:
  269.  
  270. ==      sysoplog(get_stringx(1,9));
  271. ==      if (incom)
  272. ==        topscreen();
  273. ==    }
  274. // SPV062I START BLOCK COPY
  275.     if (strcmp(s,"NMM")==0) {
  276.       sysoplog("@ Used NetMultiMail");
  277.       irt[0]=irt_name[0]=0;
  278.       nmmail("");
  279.     }
  280.     if (strcmp(s,"HOST")==0) {
  281.       xnp=xsubs[usub[cursub].subnum].nets;
  282.       sprintf(irt,"5RE2: 9Your subboard - 1%s0",
  283.               subboards[usub[cursub].subnum].name);
  284.       sysoplog("@ Used HOST NetMultiMail");
  285.       nln(2);
  286.       if ((xsubs[usub[cursub].subnum].nets[0].host) &&
  287.                 (xsubs[usub[cursub].subnum].num_nets)) {
  288.         pl("6Searching Database, Please standby...0");
  289.         i2=find_loc_host();
  290.         if (i2!=1) {
  291.           email(i2,0,0,0);
  292.         } else {
  293.           set_net_num(xsubs[usub[cursub].subnum].nets[0].net_num);
  294.           sprintf(irt,"5%s 3(9Type2: 1%s3)0",
  295.                       subboards[usub[cursub].subnum].name,xnp->stype);
  296.           email(1,xsubs[usub[cursub].subnum].nets[0].host,0,0);
  297.           set_net_num(0);
  298.         }
  299.       }
  300.       if ((!xsubs[usub[cursub].subnum].nets[0].host) &&
  301.                 (xsubs[usub[cursub].subnum].num_nets)) {
  302.         i1=0;
  303.         if (so()) {
  304.           npr("5Send to subscribers? 0");
  305.           i1=yn();
  306.           nl();
  307.         }
  308.         if (i1) {
  309.           sprintf(irt,"5%s 3(9Type2: 1%s3)0",
  310.                       subboards[usub[cursub].subnum].name,xnp->stype);
  311.           sprintf(s1,"%sNMMAIL%2.2d.NMM",syscfg.gfilesdir,instance);
  312.           fw=fsh_open(s1,"wt+");
  313.           for (i=0,xnp=xsubs[usub[cursub].subnum].nets;
  314.                         i<xsubs[usub[cursub].subnum].num_nets; i++,xnp++) {
  315.             sprintf(s1,"%sN%s.NET",net_networks[xnp->net_num].dir,
  316.                     xnp->stype);
  317.             if (exist(s1)) {
  318.               fr=fsh_open(s1,"rt");
  319.               ok=1;
  320.               do {
  321.                 fgets(s2,15,fr);
  322.                 s2[strlen(s2)-1]=0;
  323.                 if (s2[0]) {
  324.                   fprintf(fw,"1@%s=%d\n",s2,xnp->net_num);
  325.                   s2[0]=0;
  326.                 }
  327.               } while (!feof(fr));
  328.               fsh_close(fr);
  329.             }
  330.           }
  331.           fsh_close(fw);
  332.           topscreen();
  333.           sprintf(s1,"NMMAIL%2.2d",instance);
  334.           nmmail(s1);
  335.         } else {
  336.           pl("6Searching Database, Please standby...0");
  337.           i2=find_loc_host();
  338.           email(i2,0,0,0);
  339.         }
  340.       }
  341.       if (!xsubs[usub[cursub].subnum].num_nets) {
  342.         pl("6Searching Database, Please standby...0");
  343.         i2=find_loc_host();
  344.         email(i2,0,0,0);
  345.       }
  346.       irt[0]=irt_name[0]=0;
  347.       set_net_num(0);
  348.     }
  349. // SPV062I END BLOCK COPY
  350. ==    if ((strcmp(s,"CHUSER")==0) || (strcmp(s,"CU")==0)) {
  351. ==      write_inst(INST_LOC_CHUSER,0,INST_FLAGS_NONE);
  352. ==      chuser();
  353. ==    }
  354. ─────────────────────────────────────────────────────────────────────────────
  355. STEP 7: Add this to VARS.H
  356.  
  357. ==                str_quit[20], str_yes[20], tc[81], ver_no1[51],
  358. ==                ver_no2[51],wwiv_net_no[20], xdate[9], *xenviron[50],
  359. -+                dlfn[81],edlfn[81], nete[5], irt_sub[81], mmtitle[81];
  360. // ADDED mmtitle[81]
  361. ==
  362. == __EXTRN__ unsigned char actsl, andwith, checksum;
  363. ─────────────────────────────────────────────────────────────────────────────
  364. STEP 8: Add the prototypes to FCNS.H
  365.  
  366. == int existprint(unsigned char *fn);
  367. == void read_message(int n, int *next, int *val);
  368. == void lineadd(messagerec *m1, char *sx, char *aux);
  369. ++ int find_loc_host(void);                                        // SPV062I
  370. ++ void nmmail(char *list_fn);                                     // SPV062I
  371. ==
  372. == /* File: msgbase1.c */
  373. ─────────────────────────────────────────────────────────────────────────────
  374. STEP 9: Recompile the whole shootin' match.
  375. ─────────────────────────────────────────────────────────────────────────────
  376. STEP 10: Create any *.NMM files in the GFILES directory that you want:
  377.  
  378.   -- Create a file in your GFILES dir for every mailing list you want to
  379.      create using the following format:
  380.  
  381.      [User Number]@[Node Number]=[Net Number]
  382.  
  383.      BTW the Net Number is using the number from INIT.  Meaning if you have
  384.      three nets and they are WWIVnet, WWIVlink and SEXnet (in that order
  385.      in INIT) then they will be equal to 0,1 & 2 respectively.  So if you
  386.      wanted to email the net you would create a file like the following
  387.      that I have called TEMP.NMM (note that what is in paranthesis does NOT
  388.      have to be in the file!!):
  389.  
  390. 1@10000=0     (Emailing #1 @10000 WWIVnet)
  391. 1@10300=2     (Emailing #1 @10300 SEXnet)
  392. 10@50801=1    (Emailing #10 @50801 WWIVlink)
  393. 288@52400=0   (Emailing #288 @52400 WWIVnet)
  394.  
  395.      NOW.... once this is done, you can email those users from the main menu
  396.      by typing //NMM and then chosing the NMM file you want.  ALSO if you are
  397.      using the //HOST option, it will AUTOMATICALLY create the NMM file for
  398.      you.  It will NOT delete, but each time the command is run it will
  399.      overwrite the last one (NMMAIL01.NMM for instance 1), that way you can
  400.      use it again using the //NMM command later.
  401. ─────────────────────────────────────────────────────────────────────────────
  402. Explanation of functions -
  403.  
  404. int find_loc_host(void);
  405.  
  406.   This function can be handy in other functions as well, it will search the
  407.   userrec for the local host (SySu) of the current sub (cursub).  It is used
  408.   to located the SySu of a sub that is local in the //HOST command.
  409.  
  410. void nmmail(char *list_fn);
  411.  
  412.   This function will email every user in the *.NMM list that it is passed.
  413.   If you do not pass it a *.NMM filename (pass it a NULL or "") then it will
  414.   prompt you for a filename from the existing ones in your GFILES dir.
  415. ─────────────────────────────────────────────────────────────────────────────
  416.    This mod is copyright 1993,1994 by Tracy Baker, aka Papa Bear, and is
  417. distributed as freeware.  Permission is granted to distribute and post this
  418.   mod on BBS systems and online services, provided no alterations are made
  419.  (removal of message headers/taglines allowed).  This mod may contain some
  420.  parts of WWIV source code, which is copyright 1988-1994 by Wayne Bell and
  421.    licensed only to registered users of WWIV.  Use of WWIV source without
  422.     registration constitutes a license violation and could lead to legal
  423.                        prosecution and certain doom.
  424.   Shareware distributors and CD-ROM publishers may not distribute this mod
  425. without express written permission of the Author or WWIV Software Services.
  426.  
  427. 7-9=1*6>2Pâpâ ßêâr6<1*9=7-0
  428.