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 >
Wrap
Text File
|
1995-09-29
|
7KB
|
202 lines
┌───────────────────────────────────────────────────────────────────────────┐
│ Mod Name : ALDUR407 Mod Author: Aldur 1@3314 IceNET │
│ Difficulty : Easy 1@11314 WWIVnet │
│ WWIV Version : 4.24a 1@13301 WWIVLink │
│ Mod Date : 09/28/95 │
│ Files Affected: MMENU.C, BBSUTL.C, FCNS.H │
│ Description : mainmenu/dlmainmenu prompt mod for time left │
└───────────────────────────────────────────────────────────────────────────┘
This mod will alter the main and transfer menu prompts so that the time
display will be in hours, minutes and seconds rather than the stock
format:
7[1Time left - 23 minutes, 15 seconds7]0
This mod requires the installation of the TFC005 mod for the extended
time display. The pertinent portions of the TFC005 mod have been
included.
Legal Note:
This modification is NOT Public Domain or Shareware and
it may not be distributed, in modified or unmodified form,
except to persons who are registered with WWIV Software
Services. For more information write: WWIV Software
Services, P.O. Box 720455, McAllen, TX 78504-0455.
MODIFICATION NOTE: I believe in well documented modifications that are
are as easy to remove as they are to install. I NEVER delete original
source code - it is always commented out so if the mod doesn't perform
the way I would like I can get back easily to what I had in the
beginning. The modification below comes with all the comments that you
will need to clearly identify what was added versus what was there in
the first place.
┌───────────────────────────────────────────────────────────────────────────┐
│ Legend: │
│ │
│ = An existing line in the stock source code │
│ + Add this line │
│ - Delete this line │
│ | Change this line │
└───────────────────────────────────────────────────────────────────────────┘
Step 0: No matter how good you are, it is a great idea to back up your
operational source code before adding this, or any other, modification.
1) Load the "MMENU.C" file
In "void mainmenu()" make the changes as indicated below:
= if (E_C) {
+ //next line out for Aldur407 mod
| // npr("1T 0- 1%s\r\n",ctim(nsl()));
+ //start Aldur407 mod
+ strcpy(s1,"7[1Time left - ");
+ if (nsl() < 3*60)
+ strcat(s1,"6");
+ //ctim to ctim2 TFC005 mod
+ strcat(s1,ctim2(nsl()));
+ strcat(s1,"7]");
+ pl(s1);
+ //stop Aldur407 mod
= sprintf(s1,"7[1%s %c7] [1%s7]", get_string(1627),
= subconfs[uconfsub[curconfsub].confnum].designator,
= stripcolors(subconfs[uconfsub[curconfsub].confnum].name));
= if (s2[0]==0)
= sprintf(s2,"7[1%s%s7] [1%s7]0 : 2",
= useconf?get_string(1398):"",
= usub[cursub].keys,
= stripcolors(subboards[usub[cursub].subnum].name));
= } else {
+ //next line out for Aldur407 mod
| // npr("T - %s\r\n",ctim(nsl()));
+ //start Aldur407 mod
+ strcpy(s1,"[Time left - ");
+ //ctim to ctim2 TFC005 mod
+ strcat(s1,ctim2(nsl()));
+ strcat(s1,"]");
+ pl(s1);
+ //stop Aldur407 mod
= sprintf(s1,"[%s %c] [%s]", get_string(1627),
= subconfs[uconfsub[curconfsub].confnum].designator,
In "void dlmainmenu()" make the changes as indicated below:
= if (E_C) {
+ // next line out for Aldur407 mod
| // npr("1T 0- 1%s\r\n",ctim(nsl()));
+ //start Aldur407 mod
+ strcpy(s1,"7[1Time left - ");
+ if (nsl() < 3*60)
+ strcat(s1,"6");
+ //ctim to ctim2 TFC005 mod
+ strcat(s1,ctim2(nsl()));
+ strcat(s1,"7]");
+ pl(s1);
+ //stop Aldur407 mod
= sprintf(s1,"7(1Conf %c7)0-7(1%s7)",
dirconfs[uconfdir[curconfdir].confnum].designator,
= stripcolors(dirconfs[uconfdir[curconfdir].confnum].name));
= if (s2[0]==0)
= sprintf(s2,"7(1%s%s7)0-7(1%s7)0 : 2",
= useconf?get_string(1399):"",
= udir[curdir].keys,
= stripcolors(directories[udir[curdir].subnum].name));
= } else {
+ //next line out for Aldur407 mod
| // npr("T - %s\r\n",ctim(nsl()));
+ //start Aldur407 mod
+ strcpy(s1,"[Time left - ");
+ //ctim to ctim2 TFC005 mod
+ strcat(s1,ctim2(nsl()));
+ strcat(s1,"]");
+ pl(s1);
+ //stop Aldur407 mod
= sprintf(s1,"(Conf %c)-(%s)",
dirconfs[uconfdir[curconfdir].confnum].designator,
= stripcolors(dirconfs[uconfdir[curconfdir].confnum].name));
Step 2) Save the MMENU.C file
Step 3) Load the BBSUTL.C file
At the bottom of the BBSUTL.C file add the following function:
//function added TFC005 mod
char *ctim2(double d)
{
static char ch2[81];
char ht[20],mt[20],st[20];
long h,m,s;
h=(long) (d/3600.0);
d-=(double) (h*3600);
m=(long) (d/60.0);
d-=(double) (m*60);
s=(long) (d);
if (h==0)
strcpy(ht,"");
else
sprintf(ht,"%ld %s",h,(h>1)?"hours":"hour");
if (m==0)
strcpy(mt,"");
else
sprintf(mt,"%ld %s",m,(m>1)?"minutes":"minute");
if (s==0)
strcpy(st,"");
else
sprintf(st,"%ld %s",s,(s>1)?"seconds":"second");
if (h==0) {
if (m==0) {
if (s==0) {
strcpy(ch2," ");
} else {
strcpy(ch2,st);
}
} else {
strcpy(ch2,mt);
if (s!=0) {
strcat(ch2,", ");
strcat(ch2,st);
}
}
} else {
strcpy(ch2,ht);
if (m==0) {
if (s!=0) {
strcat(ch2,", ");
strcat(ch2,st);
}
} else {
strcat(ch2,", ");
strcat(ch2,mt);
if (s!=0) {
strcat(ch2,", ");
strcat(ch2,st);
}
}
}
return(ch2);
}
//stop TFC005 Mod
Step 4) Save the BBSUTL.C file
Step 5) Load the FCNS.H file
At the end of the "/* File: bbsutl.c */" section, add the following
line:
+ char *ctim2(double d);
Step 6) Save the FCNS.H file
Step 7) Recompile the board
Note - this will be a complete recompile since we made an addition
to the FCNS.H file.