home *** CD-ROM | disk | FTP | other *** search
- Nicolas Leblanc #2 @20302
- Sun Jun 18 23:40:51 1995
- ┌┬─── ── ─ ─ ── ───────────────────────────────────────────────────┬─ ∙∙
- ││ Alternative Worlds Presents │
- └┼─────────────────────────────────────────────────────────────────────┐
- ││ Mod Name » FMD-36a.MOD │∙
- ││ Difficulty » █▒▒▒▒▒▒▒▒▒▒ (1/10) │:
- ││ WWIV Version » 4.24 ││
- ││ Date Affected » 06/01/95 ││
- :│ Files Affected » XFEROVL2.C / NEWUSER.C / COM.C / MISCCMD.C ││
- :│ UEDIT.C ││
- ∙│ Description » Slashes And Dashes System For WWIV ││
- └─────────────────────────────────────────────────────────────────────┼┐
- │ A French Mod Division Release - (C) 1995 FMD Software ││
- ∙∙ ─┴─────────────────────────────────────────────────── ── ─ ─ ── ───└┘
-
- ┌┬══════════════════┐
- ││ Long Description ││
- └══════════════════┴┘
-
- This modification will enhance your system, particulary the new user
- routine. It will input slashes and dashes automatically in phone numbers,
- zip code, birthday and nscan date.
-
- It will also be Canadian aware, it will allow us, Canadians to enter our
- postcal code in the correct format, but only if the user enter CAN as his
- country.
-
- It will also take care of the bbslist phone input.
-
- Revision A:
-
- - Updated for WWIV v4.24
- - More robust bday prompt
- - Fixed goxy problem when entering unvalid bday
-
- ┌┬═══════┐
- ││ Tests ││
- └═══════┴┘
-
- This modification has been tested on a virgin WWIV v4.24 source using
- Borland C++ v4.5
-
- ──────────────────────────────────────────────────────────────────────────────
- Legend
- ╔═══╤══════════════════┐
- │ + │ Add This Line │
- │ - │ Delete This Line │
- │ * │ Modify This Line │
- │ = │ Existing Line │
- └═══╧══════════════════╝
- ───[Step 1]────────────────────────────────────────────────────────────────────
-
- Load COM.C and put the following function after void mpl(...)
-
- void mpl2(int i)
- {
- char s[81];
-
- if (okansi()) {
- npr("9[4%s9]", charstr(i, ' '));
- outstr("\x1b[");
- itoa(i + 1, s, 10);
- outstr(s);
- outstr("D");
- ansic(4);
- }
- }
-
- and this one after char onek:
-
- char oneknlf(char *s)
- {
- char ch;
-
- while (!strchr(s, ch = upcase(getkey())) && !hangup)
- ;
- if (hangup)
- ch = s[0];
- if (ch!='\b')
- outchr(ch);
- return(ch);
- }
-
- And this one at the end of the file:
-
- void get_phone(char *phone)
- {
- int i=0;
- char c;
-
- do
- {
- if (i<12)
- c=oneknlf("0123456789\b\r\n");
- else
- c=oneknlf("\b\r\n");
- phone[i]=c;
- if (phone[i]=='\b')
- {
- if (i>0)
- {
- i--;
- if ((i==3) || (i==7))
- {
- outstr("\b\b \b\b");
- i--;
- } else
- backspace();
- }
- } else {
- i++;
- }
- if (i==3||i==7)
- {
- phone[i]='-';
- outchr('-');
- i++;
- }
- } while((!hangup) && (c!='\r'&&c!='\n'&&i<13));
- nl();
- if (i<12)
- phone[0]=0;
- phone[12]=0;
- }
-
- ───[Step 2]────────────────────────────────────────────────────────────────────
-
- Load NEWUSER.C and replace the following 3 functions
-
- void input_phone(void)
- {
- int i=0;
- char c;
-
- nl();
- ansic(3);
- pl(get_string(527));
- ansic(3);
- pl(get_string(493));
- prt(2,":");
- mpl(12);
- do
- {
- if (i<12)
- c=oneknlf("0123456789\b");
- else
- c=oneknlf("\b\r\n");
- thisuser.phone[i]=c;
- if (thisuser.phone[i]=='\b')
- {
- if (i>0)
- {
- i--;
- if ((i==3) || (i==7))
- {
- outstr("\b\b \b\b");
- i--;
- } else
- backspace();
- }
- } else {
- i++;
- }
- if (i==3||i==7)
- {
- thisuser.phone[i]='-';
- outchr('-');
- i++;
- }
- } while((!hangup) && (c!='\r'&&c!='\n'&&i<13));
- nl();
- if (i<12)
- thisuser.phone[0]=0;
- thisuser.phone[12]=0;
- }
-
- void input_dataphone(void)
- {
- int i=0;
- char c;
-
- nl();
- ansic(3);
- pl(get_string(540));
- ansic(3);
- pl(get_string(493));
- prt(2,":");
- mpl(12);
- do
- {
- if (i<12)
- c=oneknlf("0123456789\b");
- else
- c=oneknlf("\b\r\n");
- thisuser.dataphone[i]=c;
- if (thisuser.dataphone[i]=='\b')
- {
- if (i>0)
- {
- i--;
- if ((i==3) || (i==7))
- {
- outstr("\b\b \b\b");
- i--;
- } else
- backspace();
- }
- } else {
- i++;
- }
- if (i==3||i==7)
- {
- thisuser.dataphone[i]='-';
- outchr('-');
- i++;
- }
- } while((!hangup) && (c!='\r'&&c!='\n'&&i<13));
- nl();
- if (i<12)
- thisuser.dataphone[0]=0;
- thisuser.dataphone[12]=0;
- }
-
- void input_age(userrec *u)
- {
- int ok,y,m,d,i;
- char ag[10], m1[3], d1[3], y1[3];
-
- do
- {
- nl();
- pl("3Enter your birthday in the format MM/DD/YY:");
- prt(2,":");
- mpl(8);
- for (i=0; i<8; i++) {
- if ((i==2) || (i==5)) {
- ag[i]='/';
- prt(4, "/");
- } else {
- ansic(4);
- switch (i)
- {
- case 0: ag[i]=oneknlf("01"); break;
- case 3: ag[i]=oneknlf("0123\b"); break;
- case 1:
- if (ag[0]=='1')
- {
- ag[i]=oneknlf("012\b");
- break;
- }
- case 4:
- if (ag[3]=='3')
- {
- ag[i]=oneknlf("01\b");
- break;
- }
- case 6: case 7: ag[i]=oneknlf("0123456789\b"); break;
- }
- if (ag[i]=='\b') {
- ag[i]=0;
- if (i>0) {
- if ((i==3) || (i==6)) {
- backspace();
- i--;
- }
- backspace();
- i-=2;
- } else {
- i=0;
- }
- }
- }
- }
- sprintf(m1, "%c%c", ag[0], ag[1]);
- sprintf(d1, "%c%c", ag[3], ag[4]);
- sprintf(y1, "%c%c", ag[6], ag[7]);
- m=atoi(m1);
- d=atoi(d1);
- y=atoi(y1)+1900;
- ok=1;
- if ((((m==2) || (m==9) || (m==4) || (m==6) || (m==11)) && (d==31)) ||
- ((m==2) && (((y%4!=0) && (d==29)) || (d==30))) ||
- (years_old((unsigned char)m, (unsigned char)d,
- (unsigned char)(y-1900))<5) || ((m==0) || (y==0) || (d==0))) {
- ok=0;
- nl();
- outstr("\76Invalid Format.");
- nl();
- i=0;
- }
- } while ((!ok) && (!hangup));
- u->month=(unsigned char) m;
- u->day=(unsigned char) d;
- u->year=(unsigned char) (y-1900);
- u->age=years_old(u->month,u->day,u->year);
- }
-
- ───[Step 3]────────────────────────────────────────────────────────────────────
-
- Load XFEROVL2.C and replace the following function:
-
- void setldate(void)
- {
- struct date d;
- struct time t;
- char s[81];
- int m,dd,y,i;
-
- unixtodos(nscandate,&d,&t);
- nl();
- ansic(7);
- npr(get_string(791));
- nln(2);
- npr("9(1Press 9[1Enter9] for 9(1%02d/%02d/%02d9)): ",d.da_mon,d.da_day,(d.da_year-1900));
- mpl2(8);
- s[0]=0;
- for (i=0; i<8; i++) {
- if ((i==2) || (i==5)) {
- s[i]='/';
- prt(4, "/");
- } else {
- ansic(4);
- switch (i)
- {
- case 0: s[i]=oneknlf("01\r"); break;
- case 3: s[i]=oneknlf("012\b\r"); break;
- case 1: case 4: case 6: case 7: s[i]=oneknlf("0123456789\b\r"); break;
- }
- if (s[i]=='\r')
- return;
- if (s[i]=='\b') {
- s[i]=0;
- if (i>0) {
- if ((i==3) || (i==6)) {
- backspace();
- i--;
- }
- backspace();
- i-=2;
- } else {
- i=0;
- }
- }
- }
- }
- nl();
- s[8]='\0';
- m=atoi(s);
- dd=atoi(&(s[3]));
- y=atoi(&(s[6]))+1900;
- if ((strlen(s)==8) && (m>0) && (m<=12) && (dd>0) && (dd<32) && (y>=1980)) {
- t.ti_min=0;
- t.ti_hour=0;
- t.ti_hund=0;
- t.ti_sec=0;
- d.da_year=y;
- d.da_day=dd;
- d.da_mon=m;
- nl();
- outstr(get_string(790));
- npr("%02d/%02d/%02d\r\n",m,dd,(y-1900));
- nl();
- nscandate=dostounix(&d,&t);
- }
- }
-
-
- ───[Step 4]────────────────────────────────────────────────────────────────────
-
- Load MISCCMD.C and do the following change to function bbslist:
-
- = pl(get_string(493));
- = outstr(":");
- = mpl(12);
- * get_phone(phone);
- = if ((phone[3]!='-') || (phone[7]!='-'))
- = phone[0]=0;
- = for (i=0; i<12; i++) {
- = if (strchr("0123456789-",phone[i])==0)
-
-
- ───[Step 5]────────────────────────────────────────────────────────────────────
-
- Load UEDIT.C and do the following changes in function uedit:
-
- = case 'P':
- = nl();
- = prt(2,get_string(272));
- * get_phone(s);
- = if (s[0]) {
- = strcpy(u.phone,s);
- = write_user(un,&u);
- = }
- = prt(2,"New data phone number? ");
- * get_phone(s);
- = if (s[0]) {
- = strcpy(u.dataphone,s);
- = write_user(un,&u);
- = }
- = break;
- = case 'Q':
- = done=1;
-
- And lower...
-
- = strcpy(u.zipcode,s1);
- = write_user(un,&u);
- = }
- = prt(2,get_string(287));
- * get_phone(s1);
- = if (s1[0]){
- = strcpy(u.dataphone,s1);
-
-
- ───[Step 6]────────────────────────────────────────────────────────────────────
-
- Do "MAKE FCNS" and compile the entire BBS, the slashes and dashes system is
- now installed on your system and should be fully working.
-
- French Proverb: Il faut que jeunesse se passe.
-
- For comments, bug report and suggestion, e-mail at the following address:
-
- Nicolas LeBlanc 2@20302.WWIVnet (aka Spotnick)
- -> spotnick@gamemaster.qc.ca
- Martin Bourdages 242@20306 / 3@20302.WWIVnet (aka Dark Shadow)
- -> martin.bourdages@radio.magicnet.com
-
- => French Mod Division Support Sub <=
- SubType: FMD
- Host: @20302 (WWIVnet)
- Scan sublist for other networks
-
- Read PRODUCTS.FMD for the full list of our support systems.
-
- ───[EOF]──────────────────────────────────────────────────────────────────────
-