home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / MODSUNKN.ZIP / FREQUEST.MOD < prev    next >
Text File  |  1990-10-07  |  4KB  |  115 lines

  1. East Bay Ray #1 @9964
  2. Wed Oct 03 22:32:19 1990
  3.                       WANTLIST MOD by MrBill (WL412.MOD)
  4.                     v4.12 Conversion by East Bay Ray 1@9964
  5.  
  6. Ok boys and girls, here's my new one. This mod came to me just a little
  7. while ago when i was wishing i had the source to the request door written
  8. by Omega Man of Byte Me BBS. I wanted to run two different request doors
  9. but couldn't since they access the same data file. So I decided to write my
  10. own mod into the bbs to get around this problem. I thank Omega Man for his
  11. indirect inspiration though [smile]. (hey, OM, in the next ver please allow
  12. a parameter for the filename, then the non-registered WWIV sysops can run
  13. multiple request doors.) Anyway, what this will do is have seperate files
  14. for EACH of your download directories that users can put up requests for
  15. files that they are looking for. It also allows easy editing of these files
  16. for the sysop (or co's). All files will be made in the gfiles dir with the
  17. same name as your directory database file (in the data dir) but with the
  18. extension of "WNT". The whole beauty of this mod is that it is not just one
  19. want list, it is one for EVERY download directory on your board and is
  20. totally secure with any DAR's or DSL's that you have set up for the
  21. different areas. Have fun!
  22.  
  23. /*****************************************************************************/
  24. /=============================================================================/
  25.         First thing for you to do is load up BBS.C and find all the case
  26. statements in void dlmainmenu(), then throw this in between any of them. If
  27. you want you can put it in alphabetical order like i did.
  28. /=============================================================================/
  29.  
  30.       case 'V':
  31.         arc_l();
  32.         break;
  33.       case 'W':                                               /* add */
  34.         wantlist();                                           /* add */
  35.         break;                                                /* add */
  36.       case 'X':
  37.  
  38. /=============================================================================/
  39.         Next load up XFEROVL.C and put this whole procedure at the end
  40. of it.
  41. /=============================================================================/
  42.  
  43. void wantlist()                                            /* add \/ */
  44. {
  45.   int i,f;
  46.   char s[81],s1[81],ch;
  47.  
  48.   nl();
  49.   strcpy(s,"MrBill's Want List for ");
  50.   strcat(s,directories[udir[curdir].subnum].name);
  51.   strcat(s," : ");
  52.   prt(3,s);
  53.   nl();
  54.   strcpy(s,directories[udir[curdir].subnum].filename);
  55.   strcat(s,".WNT");
  56.   printfile(s);
  57.   prt(5,"Add to the list? ");
  58.   if (yn()){
  59.     pl("[-----Program Name-----][Version][---Author/Pub---][----Small
  60.               Description-----]");
  61.     outstr(":");
  62.     mpl(78);
  63.     inputl(s1,78);
  64.     for (i=strlen(s1); i<80; i++)
  65.        s1[i]=32;
  66.     s1[i]=0;
  67.     nl();
  68.     nl();
  69.     pl(s1);
  70.     prt(5,"Is this what you want? ");
  71.     if (yn()){
  72.       strcpy(s,"WANTS:");
  73.       strncat(s,s1,69);
  74.       sysoplog(s);
  75.       strcpy(s,syscfg.gfilesdir);
  76.       strcat(s,directories[udir[curdir].subnum].filename);
  77.       strcat(s,".WNT");
  78.       f=open(s,O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
  79.       if (filelength(f)) {
  80.         lseek(f,-1L,SEEK_END);
  81.         read(f,((void *)&ch),1);
  82.         if (ch==26)
  83.           lseek(f,-1L,SEEK_END);
  84.       }
  85.       s1[79]='\r';
  86.       s1[80]='\n';
  87.       s1[81]=0;
  88.       write(f,(void *)s1,81);
  89.       close(f);
  90.       nl();
  91.       pl("Your request has been added. ");
  92.     }
  93.   }
  94.   if (cs()) {           /* change to so if you want sysop only to edit */
  95.     prt(5,"Edit Want List? ");
  96.     if (yn()){
  97.        strcpy(s,directories[udir[curdir].subnum].filename);
  98.        strcat(s,".WNT");
  99.        if (okfsed())
  100.          external_edit(s,syscfg.gfilesdir,thisuser.defed-1,500);
  101.        else
  102.          tedit(s);
  103.     }
  104.   }
  105. }
  106.  
  107. /=============================================================================/
  108. Now YOU MUST add the following line to FCNS.H:
  109.  
  110. void wantlist()
  111.  
  112.         The only thing left now is to update your menus so that your users
  113. will see the new command, and of course post a message or two so that those
  114. who are in expert mode will know about it. I hope it is as usefull to you as
  115. it is to me.