home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / UTILITY / MERD100.ZIP / MTAGLINE.MOD < prev    next >
Text File  |  1991-09-21  |  2KB  |  65 lines

  1.                               MTagline.mod
  2.                       for WWIV 4.12 and WWIV 4.20
  3.          (probably requires modifiation for previous versions)
  4.  
  5.  
  6.      This mod adds a tagline to all net posts whether made with Wayne's built
  7. in editor or an external editor.  This has probably been done before, but since
  8. I couldn't find one that does this in my transfer section, I wrote my own.
  9. This mod goes in void inmsg(...) in msgbase.c.  Your tagline goes in tagline.txt
  10. in your GFILES directory.  Right now, this mod will only read in 2K of
  11. tagline.txt.  If you have a gigantic (and probably illegal) tagline, you can
  12. change both references to 2048 to a larger number.
  13.  
  14.     if (fsed) {
  15.       ll=filelength(i5);
  16.       read(i5, (void *) (& (b[l1]) ),ll);
  17.       l1 += ll;
  18.       close(i5);
  19.     } else {
  20.       for (i5=0; i5<curli; i5++)
  21.         addline(b,&(lin[i5*LEN]),&l1);
  22.     }
  23. /****************************************************************************/
  24.     if( (subboards[curlsub].type) && (strcmp(aux,"EMAIL")) ) {  /* add block */
  25.       sprintf(s,"%sTAGLINE.TXT", syscfg.gfilesdir);
  26.       if( (i=open(s, O_RDONLY | O_BINARY)) < 0 ) {
  27.         ansic(6);
  28.         npr("%s not found!\r\n", s);                            /* 4.20 code */
  29.       } else {
  30.         if( (ss= (char *) malloca(2048L)) != NULL) {
  31.           i1=i4=0;
  32.           i2=read(i,ss,2048);
  33.           close(i);
  34.           addline(b,"",&l1);
  35.           while(i1 < i2) {
  36.             while(*(ss+i1) != 13 && i1 < i2)
  37.               i1++;
  38.             *(ss+i1)=0;
  39.             addline(b,ss+i4,&l1);
  40.             i4=i1+2;
  41.           }
  42.           farfree(ss);
  43.         }
  44.       }
  45.     }                                                          /* end block */
  46. /****************************************************************************/
  47.     if (b[l1-1]!=26)
  48.       b[l1++]=26;
  49.     savefile(b,l1,&m,aux);
  50.     if (fsed)
  51.       unlink(fnx);
  52.  
  53. If you are using WWIV 4.12 replace the line marked "4.20 code" with the
  54. following:
  55.  
  56.         print(s," not found!","");                              /* 4.12 code */
  57.  
  58. That's it!  Any problems, I can be reached at 1@13124 or on my board,
  59. The Mages' Guild at 410-939-9139.
  60.  
  61.  /     \
  62. -Merdion-
  63.  \     /
  64.  
  65.