home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / EVENTS / FVB097B.ZIP / FMD-06.MOD < prev    next >
Text File  |  1995-05-02  |  7KB  |  243 lines

  1.  
  2.    ┌┬─── ──  ─   ─  ── ───────────────────────────────────────────────────┬─ ∙∙
  3.    ││                    Alternative Worlds Presents                      │
  4.    └┼─────────────────────────────────────────────────────────────────────┐
  5.    ││ Mod Name       » FMD-06.MOD (Release Version)                       │∙
  6.    ││ Difficulty     » █▒▒▒▒▒▒▒▒▒▒ (1/10)                                 │:
  7.    ││ WWIV Version   » 4.23                                               ││
  8.    ││ Date Affected  » 02/01/95                                           ││
  9.    :│ Files Affected » BBS.C / LILO.C / VOTEEDIT.C / MISCCMD.C / VARS.H   ││
  10.    ∙│ Description    » Run FMD Voting Booth From Inside WWIV              ││
  11.     └─────────────────────────────────────────────────────────────────────┼┐
  12.     │       A French Mod Division Release - (C) 1995 FMD Software         ││
  13. ∙∙ ─┴─────────────────────────────────────────────────── ──  ─   ─  ── ───└┘
  14.  
  15.  
  16.  ┌┬══════════════════┐
  17.  ││ Long Description ││
  18.   └══════════════════┴┘
  19.  
  20.  
  21.    This modification will rip off the internal WWIV voting functions to replace
  22. them by the external voting booth from French Mod Division. This will save
  23. you Dgroup space and will reduce the size of your BBS.EXE, and you will enjoy
  24. the voting booth system done by French Mod Division.
  25.  
  26. ──────────────────────────────────────────────────────────────────────────────
  27.                                    Legend
  28.                           ╔═══╤══════════════════┐
  29.                           │ + │ Add This Line    │
  30.                           │ - │ Delete This Line │
  31.                           │ * │ Modify This Line │
  32.                           │ = │ Existing Line    │
  33.                           └═══╧══════════════════╝
  34. ───[Step 1]────────────────────────────────────────────────────────────────────
  35.  
  36. Load LILO.C and to the following change in void logon:
  37.  
  38.  
  39. =  nscandate=thisuser.daten;
  40. =  batchtime=0.0;
  41. =  numbatchdl=numbatch=0;
  42. -  i1=0;
  43. -  for (i=0; i<20; i++) {
  44. -    if (questused[i]) {
  45. -      if (thisuser.votes[i]==0) {
  46. -        i1=1;
  47. -      }
  48. -    }
  49. -  }
  50. -  if (restrict_vote & thisuser.restrict)
  51. -    i1=0;
  52. -  if (actsl<=syscfg.newusersl)
  53. -    i1=0;
  54. -
  55. *  if (live_user) {
  56. =    nl();
  57. *    enter_vote();
  58. =    nl();
  59. =  }
  60. =  if ((incom) || (sysop1()))
  61. =    broadcast(get_string(1172));
  62.  
  63. ───[Step 2]────────────────────────────────────────────────────────────────────
  64.  
  65.   Load MISCCMD.C, and delete the following functions:
  66.  
  67. - void print_quest(void);
  68. - int print_question(int i, int ii);
  69. - void vote_question(void);
  70.  
  71.   Then replace void vote with the following one:
  72.  
  73. void vote(void)
  74. {
  75.   char s[81];
  76.   int i;
  77.  
  78.   create_chain_file();
  79.   if (!(restrict_vote & thisuser.restrict)) {
  80.     topscreen();
  81.     if (instance>1)
  82.       sprintf(s,"VOTE.EXE CHAIN.%3.3d /O",instance);
  83.     else
  84.       strcpy(s,"VOTE.EXE CHAIN.TXT /O");
  85. #ifdef WWIV424
  86.     extern_prog(s,EFLAG_SHRINK|EFLAG_COMIO|EFLAG_INTERNAL|EFLAG_TOPSCREEN);
  87. #else
  88.     full_external(s,0,1);
  89. #endif
  90.   }
  91. }
  92.  
  93. Add the following function just after void vote:
  94.  
  95. void enter_vote(void)
  96. {
  97.   char s[81];
  98.   int i;
  99.  
  100.   create_chain_file();
  101.   if (!(restrict_vote & thisuser.restrict)) {
  102.     topscreen();
  103.     if (instance>1)
  104.       sprintf(s,"VOTE.EXE CHAIN.%3.3d /L",instance);
  105.     else
  106.       strcpy(s,"VOTE.EXE CHAIN.TXT /L");
  107. #ifdef WWIV424
  108.     extern_prog(s,EFLAG_SHRINK|EFLAG_COMIO|EFLAG_INTERNAL|EFLAG_TOPSCREEN);
  109. #else
  110.     full_external(s,0,1);
  111. #endif
  112.   }
  113. }
  114.  
  115. ───[Step 3]────────────────────────────────────────────────────────────────────
  116.  
  117.   Load UEDIT.C, and do the following changes to void uedit:
  118.  
  119.  
  120. =        sh_lseek(f,((long) i) * sizeof(mailrec), SEEK_SET);
  121. =        sh_read(f,(void *)(&m),sizeof(mailrec));
  122. =        if (((m.tosys==0) && (m.touser==un)) ||
  123. =            ((m.fromsys==0) && (m.fromuser==un))) {
  124. =          delmail(f,i);
  125. =        }
  126. =      }
  127. =      f=sh_close(f);
  128. =    }
  129. -    sprintf(fn,"%sVOTING.DAT",syscfg.datadir);
  130. -    f=sh_open(fn,O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
  131. -    n=(int) (filelength(f) / sizeof(votingrec)) -1;
  132. -    for (i=0; i<20; i++)
  133. -      if (u.votes[i]) {
  134. -        if (i<=n) {
  135. -          sh_lseek(f,((long) i) * sizeof(votingrec), SEEK_SET);
  136. -          sh_read(f,(void *)&v,sizeof(votingrec));
  137. -          vr=v.responses[u.votes[i]-1];
  138. -          vr.numresponses--;
  139. -          v.responses[u.votes[i]-1]=vr;
  140. -          sh_lseek(f,((long) i) * sizeof(votingrec), SEEK_SET);
  141. -          sh_write(f,(void *)&v,sizeof(votingrec));
  142. -        }
  143. -        u.votes[i]=0;
  144. -      }
  145. -    f=sh_close(f);
  146. =    write_user(un,&u);
  147. =  }
  148. =}
  149.  
  150. ───[Step 4]────────────────────────────────────────────────────────────────────
  151.  
  152. Load VOTEEDIT.C and delete the following functions:
  153.  
  154. - void print_quests(void);
  155. - void set_question(void);
  156.  
  157. And replace the two following functions:
  158.  
  159. void ivotes(void)
  160. {
  161.   char s1[101];
  162.   int i;
  163.  
  164.   i=topdata;
  165.   topdata=0;
  166.   topscreen();
  167.   create_chain_file();
  168.   if (instance>1)
  169.     sprintf(s1,"VOTE.EXE CHAIN.%3.3d /S",instance);
  170.   else
  171.    strcpy(s1,"VOTE.EXE CHAIN.TXT /S");
  172. #ifdef WWIV424
  173.   extern_prog(s1,EFLAG_SHRINK|EFLAG_COMIO|EFLAG_INTERNAL|EFLAG_TOPSCREEN);
  174. #else
  175.   full_external(s1,0,1);
  176. #endif
  177.   topdata=i;
  178. }
  179.  
  180.  
  181. void voteprint(void)
  182. {
  183.   char s[81];
  184.  
  185.   create_chain_file();
  186.   if (instance>1)
  187.     sprintf(s,"VOTE.EXE CHAIN.%3.3d /V",instance);
  188.   else
  189.     strcpy(s,"VOTE.EXE CHAIN.TXT /V");
  190. #ifdef WWIV424
  191.    extern_prog(s,EFLAG_SHRINK|EFLAG_COMIO|EFLAG_INTERNAL);
  192. #else
  193.    full_external(s,0,1);
  194. #endif
  195. }
  196.  
  197. ───[Step 5]────────────────────────────────────────────────────────────────────
  198.  
  199. Load XINIT.C and delete the following void:
  200.  
  201. void read_voting(void);
  202.  
  203. And delete the following line in void init:
  204.  
  205. =    xenviron[i1++]="PKNOFASTCHAR=Y";
  206. =  xenviron[i1]=NULL;
  207. =
  208. -  read_voting();
  209. =
  210. =  if (syscfgovr.comflags & comflags_buffered_uart)
  211. =    high_speed=1;
  212.  
  213.  
  214. ───[Step 6]────────────────────────────────────────────────────────────────────
  215.  
  216. Load VARS.H and delete "questused[20]"
  217.  
  218. =              num_sys_list, oklevel, okmacro, okskey, ok_modem_stuff,
  219. *              oldx, oldy, ooneuser, outcom,
  220. =              restoring_shrink, save_dos, screenbottom, screenlen,
  221.  
  222. ───[Step 7]────────────────────────────────────────────────────────────────────
  223.  
  224. Compile the entire board (you need to rebuild FCNS.H), put VOTE.EXE in your
  225. main WWIV directory, and everything should work fine. If you are running WWIV
  226. v4.24, you will need to add "#define WWIV424" at the end of VARS.H to be sure
  227. it will select the v4.24 code, or you can delete the v4.24 and #define, #else,
  228. #endif lines if you feel confident to do so.
  229.  
  230. French Proverb: Pierre qui roule n'amasse pas mousse.
  231.  
  232. For comments, bug report and suggestion, e-mail at the following address:
  233.  
  234.        Spotnick    1@20397.WWIVnet       Dark Shadow 1@20305.WWIVnet
  235.        SysOp of Alternative Worlds       SysOp of French Mod Division HQ
  236.  
  237.  
  238.                  =>   French Mod Division Support Sub   <=
  239.                                 SubType: ESE
  240.                    Host: @20397 (WWIVnet) / @5497 Others
  241.  
  242. ───[EOF]──────────────────────────────────────────────────────────────────────
  243.