home *** CD-ROM | disk | FTP | other *** search
- Nicolas Leblanc #2 @20302
- Sun Jun 18 23:41:37 1995
- ┌┬─── ── ─ ─ ── ───────────────────────────────────────────────────┬─ ∙∙
- ││ Alternative Worlds Presents │
- └┼─────────────────────────────────────────────────────────────────────┐
- ││ Mod Name » FMD-38a.MOD │∙
- ││ Difficulty » █▒▒▒▒▒▒▒▒▒▒ (1/10) │:
- ││ WWIV Version » 4.24 ││
- ││ Date Affected » 06/01/95 ││
- :│ Files Affected » MISCCMD.C / VARDEC.H / LILO.C / MMENU.C ││
- ∙│ Description » Send Memo To Other Users. ││
- └─────────────────────────────────────────────────────────────────────┼┐
- │ A French Mod Division Release - (C) 1995 FMD Software ││
- ∙∙ ─┴─────────────────────────────────────────────────── ── ─ ─ ── ───└┘
-
-
- ┌┬══════════════════┐
- ││ Long Description ││
- └══════════════════┴┘
-
- This modification will give to your system another type of messages that
- users can send, a memo, a 2 lines message. This can also be used instead of
- SSM and it is very useful for system messages.
-
- The memo can be replied and saved.
-
- Revision A:
-
- - Updated for WWIV v4.24
-
- ┌┬═══════┐
- ││ 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 up VARDEC.H, add the following structure just after batchrec:
-
-
- + typedef struct
- + {
- + char message[81], /* Line 1 */
- + message1[81], /* Line 2 */
- + from[41]; /* From */
- + unsigned short touser; /* To */
- + } memo;
-
- ───[Step 2]────────────────────────────────────────────────────────────────────
-
- Load up MISCCMD.C, add the following functions at the end of the file.
-
- void systememo(int un, char *s,char *s2)
- /*
- * Example : systememo(1, "Line 1", "Line 2"); un = User #
- */
- {
- int f, i, i1;
- userrec u;
- char s1[81];
- memo memorec;
-
- sprintf(s1,"%sMEMO.DAT",syscfg.datadir);
- f=sh_open(s1,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE);
- i=(int) (filelength(f) / sizeof(memo));
- i1=i-1;
- if (i1>=0)
- {
- sh_lseek(f,((long) (i1)) * sizeof(memo), SEEK_SET);
- sh_read(f,(void *)&memorec,sizeof(memo));
- while ((memorec.touser==0) && (i1>0))
- {
- --i1;
- sh_lseek(f,((long) (i1)) * sizeof(memo), SEEK_SET);
- sh_read(f,(void *)&memorec,sizeof(memo));
- }
- if (memorec.touser)
- ++i1;
- }
- else
- i1=0;
- memorec.touser=un;
- strcpy(memorec.message,s);
- strcpy(memorec.message1,s2);
- strcpy(memorec.from,syscfg.systemname);
- sh_lseek(f,((long) (i1)) * sizeof(memo), SEEK_SET);
- sh_write(f,(void *)&memorec,sizeof(memo));
- sh_close(f);
- }
-
- void send_memo(char *s)
- /* Example : send_memo("dark shadow") or send_memo("") = Ask User */
- { int f, i, i1, ui;
- char s1[81],*s2;
- userrec u;
- memo memorec;
-
- nl();
- npr("2Send Memo To : ");
- mpl(40);
- if (!s[0])
- input(s1,40);
- else
- {
- s2=strupr(s);
- strcpy(s1,s2);
- npr("%s\r\n",s1);
- }
- ui=finduser1(s1);
- if (ui>0)
- {
- read_user(ui,&u);
- sprintf(s1,"%sMEMO.DAT",syscfg.datadir);
- f=sh_open(s1,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE);
- i=(int) (filelength(f) / sizeof(memo));
- i1=i-1;
- if (i1>=0)
- {
- sh_lseek(f,((long) (i1)) * sizeof(memo), SEEK_SET);
- sh_read(f,(void *)&memorec,sizeof(memo));
- while ((memorec.touser==0) && (i1>0))
- {
- --i1;
- sh_lseek(f,((long) (i1)) * sizeof(memo), SEEK_SET);
- sh_read(f,(void *)&memorec,sizeof(memo));
- }
- if (memorec.touser)
- ++i1;
- }
- else
- i1=0;
- memorec.touser=ui;
- strcpy(memorec.from,thisuser.name);
- npr("\r\n 2Ok, Enter Your Memo, You Have Two Lines.\r\n");
- npr(" [---------------------------------------------------------------------------]\r\n");
- npr(": ");
- inputl(memorec.message,75);
- npr(": ");
- inputl(memorec.message1,75);
- npr("\r\n5Sending.... ");
- sh_lseek(f,((long) (i1)) * sizeof(memo),SEEK_SET);
- sh_write(f,(void *)&memorec,sizeof(memo));
- sh_close(f);
- npr("5Done\r\n");
- }
- else
- {
- npr("Unknown User");
- s[0]=0;
- }
- }
-
- void read_memo(void)
- /* Example : read_memo(); */
- {
- int i, i2=1, f, i1;
- char s1[81], ch;
- memo memorec;
-
- npr("5Scanning for Memo....\r\n");
- sprintf(s1,"%sMEMO.DAT",syscfg.datadir);
- f=sh_open(s1,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE);
- i=(int) (filelength(f) / sizeof(memo));
- for (i1=0; i1<i; i1++)
- {
- sh_lseek(f,((long) (i1)) * sizeof(memo),SEEK_SET);
- sh_read(f,(void *)&memorec,sizeof(memo));
- if (memorec.touser==usernum)
- {
- i2=0;
- nl();
- npr("1You Have a Memo From : %s\r\n",memorec.from);
- npr("%s\r\n",memorec.message);
- npr("%s\r\n",memorec.message1);
- nl();
- npr("2[D]elete [R]eply [I]gnore : ");
- ch=onek("DRI");
- switch(ch)
- {
- case 'D':
- memorec.touser=0;
- memorec.from[0]=0;
- memorec.message[0]=0;
- memorec.message1[0]=0;
- sh_lseek(f,((long) (i1)) * sizeof(memo),SEEK_SET);
- sh_write(f,(void *)&memorec,sizeof(memo));
- break;
- case 'R':
- strcpy(s1,memorec.from);
- memorec.touser=0;
- memorec.from[0]=0;
- memorec.message[0]=0;
- memorec.message1[0]=0;
- sh_lseek(f,((long) (i1)) * sizeof(memo),SEEK_SET);
- sh_write(f,(void *)&memorec,sizeof(memo));
- send_memo(s1);
- break;
- }
- }
- }
- sh_close(f);
- if (i2)
- npr("5Nothing For You Today....\r\n");
- }
-
-
- ───[Step 3]────────────────────────────────────────────────────────────────────
-
- Load BBS.C, add the following code:
-
- = if ((strcmp(s,"UPLOAD")==0) && (actsl>10))
- = upload_post();
- + if ((strcmp(s,"MEMO")==0) && (actsl>syscfg.newusersl))
- + send_memo("");
- = if (strcmp(s,"QWK")==0)
- = qwk_menu();
- = if (strcmp(s,"CLS")==0) {
-
- ───[Step 4]────────────────────────────────────────────────────────────────────
-
- Load LILO.C and change the following code in function logon:
-
- = }
- = topscreen();
- = create_chain_file();
- = rsm(usernum,&thisuser,1);
- + read_memo();
- = if (thisuser.waiting) {
- = if (menu_on()) {
- = printmenu(324);
- = rip_popup = 0; /* Disable the Yes/No prompt */
-
- ───[Step 5]────────────────────────────────────────────────────────────────────
-
- This is the 2nd function of that mod, you can send memo to users
- from "WWIV" as you like, you can add them everywhere you want.
- Example is: systememo(54,"Happy Birthday","Dear User."); or
- anything like it, the function use is:
-
- systememo(usernumber,"Line 1","Line 2");
-
- As long as you will use this function, you will find many place in your
- system and a better way to use this, many functions can be done with
- this powerful tool, it's a better way that SSM, except that it's only
- available locally.
-
- Example of use in case a newuser is validated on your system:
-
- In NEWUSER.C
-
- = if (strcmp(s,thisuser.pw)==0)
- = ok=1;
- = } while ((!ok) && (!hangup));
- + sprintf(s, "%s just validated today", thisuser.name);
- + systememo(1, "New User Notice", s);
- = checkit=0;
- = if (incom) {
- = if (printfile("FEEDBACK"))
- = sl1(0,get_stringx(1,29));
- = feedback(1);
- = }
-
- ───[Step 6]────────────────────────────────────────────────────────────────────
-
- That's it, simply do a MAKE FCNS and recompile the entire system. You need to
- update your menus to let your user know that the //MEMO command exists. Also,
- this mod can be easily modified to send memo to all users or send memo from
- specific source, it's up to you!
-
-
- French Proverb: Il n'y a que la vérité qui blesse.
-
- 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]──────────────────────────────────────────────────────────────────────
-