home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / SYSOP / MODS1.ZIP / ALDUR407.MOD < prev    next >
Text File  |  1995-09-29  |  7KB  |  202 lines

  1. ┌───────────────────────────────────────────────────────────────────────────┐
  2. │ Mod Name      : ALDUR407               Mod Author: Aldur 1@3314  IceNET   │
  3. │ Difficulty    : Easy                                     1@11314 WWIVnet  │
  4. │ WWIV Version  : 4.24a                                    1@13301 WWIVLink │
  5. │ Mod Date      : 09/28/95                                                  │
  6. │ Files Affected: MMENU.C, BBSUTL.C, FCNS.H                                 │
  7. │ Description   : mainmenu/dlmainmenu prompt mod for time left              │
  8. └───────────────────────────────────────────────────────────────────────────┘
  9.  
  10. This mod will alter the main and transfer menu prompts so that the time
  11. display will be in hours, minutes and seconds rather than the stock
  12. format:
  13.  
  14.      7[1Time left - 23 minutes, 15 seconds7]0
  15.  
  16. This mod requires the installation of the TFC005 mod for the extended
  17. time display.  The pertinent portions of the TFC005 mod have been
  18. included.
  19.  
  20.     Legal Note:
  21.        This modification is NOT Public Domain or Shareware and
  22.        it may not be distributed, in modified or unmodified form,
  23.        except to persons who are registered with WWIV Software
  24.        Services.  For more information write: WWIV Software
  25.        Services, P.O. Box 720455, McAllen, TX 78504-0455.
  26.  
  27. MODIFICATION NOTE:  I believe in well documented modifications that are
  28. are as easy to remove as they are to install.  I NEVER delete original
  29. source code - it is always commented out so if the mod doesn't perform
  30. the way I would like I can get back easily to what I had in the
  31. beginning.  The modification below comes with all the comments that you
  32. will need to clearly identify what was added versus what was there in
  33. the first place.
  34.  
  35. ┌───────────────────────────────────────────────────────────────────────────┐
  36. │ Legend:                                                                   │
  37. │                                                                           │
  38. │  = An existing line in the stock source code                              │
  39. │  + Add this line                                                          │
  40. │  - Delete this line                                                       │
  41. │  | Change this line                                                       │
  42. └───────────────────────────────────────────────────────────────────────────┘
  43.  
  44. Step 0:  No matter how good you are, it is a great idea to back up your
  45. operational source code before adding this, or any other, modification.
  46.  
  47. 1)  Load the "MMENU.C" file
  48.  
  49.     In "void mainmenu()" make the changes as indicated below:
  50.  
  51. =     if (E_C) {
  52. +   //next line out for Aldur407 mod
  53. |   //    npr("1T 0- 1%s\r\n",ctim(nsl()));
  54. +   //start Aldur407 mod
  55. +       strcpy(s1,"7[1Time left - ");
  56. +       if (nsl() < 3*60)
  57. +         strcat(s1,"6");
  58. +       //ctim to ctim2 TFC005 mod
  59. +       strcat(s1,ctim2(nsl()));
  60. +       strcat(s1,"7]");
  61. +       pl(s1);
  62. +   //stop Aldur407 mod
  63. =       sprintf(s1,"7[1%s %c7] [1%s7]", get_string(1627),
  64. =               subconfs[uconfsub[curconfsub].confnum].designator,
  65. =         stripcolors(subconfs[uconfsub[curconfsub].confnum].name));
  66. =       if (s2[0]==0)
  67. =         sprintf(s2,"7[1%s%s7] [1%s7]0 : 2",
  68. =           useconf?get_string(1398):"",
  69. =           usub[cursub].keys,
  70. =           stripcolors(subboards[usub[cursub].subnum].name));
  71. =     } else {
  72. +   //next line out for Aldur407 mod
  73. |   //    npr("T - %s\r\n",ctim(nsl()));
  74. +   //start Aldur407 mod
  75. +       strcpy(s1,"[Time left - ");
  76. +       //ctim to ctim2 TFC005 mod
  77. +       strcat(s1,ctim2(nsl()));
  78. +       strcat(s1,"]");
  79. +       pl(s1);
  80. +   //stop Aldur407 mod
  81. =       sprintf(s1,"[%s %c] [%s]", get_string(1627),
  82. =         subconfs[uconfsub[curconfsub].confnum].designator,
  83.  
  84.  
  85.    In "void dlmainmenu()" make the changes as indicated below:
  86.  
  87. =     if (E_C) {
  88. +   // next line out for Aldur407 mod
  89. |   //  npr("1T 0- 1%s\r\n",ctim(nsl()));
  90. +   //start Aldur407 mod
  91. +       strcpy(s1,"7[1Time left - ");
  92. +       if (nsl() < 3*60)
  93. +         strcat(s1,"6");
  94. +   //ctim to ctim2 TFC005 mod
  95. +       strcat(s1,ctim2(nsl()));
  96. +       strcat(s1,"7]");
  97. +       pl(s1);
  98. +   //stop Aldur407 mod
  99. =       sprintf(s1,"7(1Conf %c7)0-7(1%s7)",
  100.                   dirconfs[uconfdir[curconfdir].confnum].designator,
  101. =         stripcolors(dirconfs[uconfdir[curconfdir].confnum].name));
  102. =       if (s2[0]==0)
  103. =         sprintf(s2,"7(1%s%s7)0-7(1%s7)0 : 2",
  104. =           useconf?get_string(1399):"",
  105. =           udir[curdir].keys,
  106. =           stripcolors(directories[udir[curdir].subnum].name));
  107. =     } else {
  108. +   //next line out for Aldur407 mod
  109. |   //  npr("T - %s\r\n",ctim(nsl()));
  110. +   //start Aldur407 mod
  111. +       strcpy(s1,"[Time left - ");
  112. +       //ctim to ctim2 TFC005 mod
  113. +       strcat(s1,ctim2(nsl()));
  114. +       strcat(s1,"]");
  115. +       pl(s1);
  116. +   //stop Aldur407 mod
  117. =       sprintf(s1,"(Conf %c)-(%s)",
  118.              dirconfs[uconfdir[curconfdir].confnum].designator,
  119. =         stripcolors(dirconfs[uconfdir[curconfdir].confnum].name));
  120.  
  121. Step 2)  Save the MMENU.C file
  122.  
  123. Step 3)  Load the BBSUTL.C file
  124.  
  125.     At the bottom of the BBSUTL.C file add the following function:
  126.  
  127. //function added TFC005 mod
  128. char *ctim2(double d)
  129. {
  130.   static char ch2[81];
  131.   char ht[20],mt[20],st[20];
  132.   long h,m,s;
  133.  
  134.   h=(long) (d/3600.0);
  135.   d-=(double) (h*3600);
  136.   m=(long) (d/60.0);
  137.   d-=(double) (m*60);
  138.   s=(long) (d);
  139.   if (h==0)
  140.     strcpy(ht,"");
  141.   else 
  142.     sprintf(ht,"%ld %s",h,(h>1)?"hours":"hour");
  143.   if (m==0)
  144.     strcpy(mt,"");
  145.   else
  146.     sprintf(mt,"%ld %s",m,(m>1)?"minutes":"minute");
  147.   if (s==0)
  148.     strcpy(st,"");
  149.   else
  150.     sprintf(st,"%ld %s",s,(s>1)?"seconds":"second");
  151.  
  152.   if (h==0) {
  153.     if (m==0) {
  154.       if (s==0) {
  155.         strcpy(ch2," ");
  156.       } else {
  157.         strcpy(ch2,st);
  158.       }
  159.     } else {
  160.       strcpy(ch2,mt);
  161.       if (s!=0) {
  162.         strcat(ch2,", ");
  163.         strcat(ch2,st);
  164.       }
  165.     }
  166.   } else {
  167.     strcpy(ch2,ht);
  168.     if (m==0) {
  169.       if (s!=0) {
  170.         strcat(ch2,", ");
  171.         strcat(ch2,st);
  172.       }
  173.     } else {
  174.       strcat(ch2,", ");
  175.       strcat(ch2,mt);
  176.       if (s!=0) {
  177.         strcat(ch2,", ");
  178.         strcat(ch2,st);
  179.       }
  180.     }
  181.   }
  182.   return(ch2);
  183. }
  184. //stop TFC005 Mod
  185.  
  186.  
  187. Step 4)  Save the BBSUTL.C file
  188.  
  189. Step 5)  Load the FCNS.H file
  190.  
  191.    At the end of the "/* File: bbsutl.c */" section, add the following
  192.    line:
  193.  
  194. +   char *ctim2(double d);
  195.  
  196. Step 6)  Save the FCNS.H file
  197.  
  198. Step 7)  Recompile the board
  199.  
  200.    Note - this will be a complete recompile since we made an addition
  201.    to the FCNS.H file.
  202.