Ok i suped up the supe up, and fixed some probs with it!!! Commander Pull #1 @17315 58š7 Commander 58š0 Fri Feb 26 18:21:13 1993 ŚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄæ ³ Mod Name: : TANIS001.MOD Author : Goose 1@17310 (WWIVLink)³ ³ Difficulty : Medium - Hard Update : Tanis Half-Elven 1@17315 ³ ³ WWIV Version : 4.22 Date : 2/26/93 ³ ³ Files Modded : FCNS.H, VARS.H, UTILITY.C, NEWUSER.C, DEFAULTS.C, UEDIT.C ³ ³ MSGBASE.C, MSGBASE1.C, SYSOPF.C. ³ ³ Description : The old Usernote mod for 4.12, revamped for 4.22 with extra³ ³ features, and utilizes the external strings. ³ ĄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄŁ What this mod does is allows each user to specify a User Comment that will be displayed at the top of the messages for local message bases. This note can be whatever the user wants - most sysops will put their board numbers there, for example, other users can use it for just about anything they want. I am rereleasing this mod for three reasons. 1. I had made some typos in the first. 2. The Usernote will now allow WWIV colors. (Becareful, 's + #'s equal two spaces in the usernote file!!! 3. The Mailr problem is now fixed. -*-*-* Also a Specail thankyou to Galen Pathwarden for his support, and *-*-*- -*-*-* encouragement. Thanx Galen! *-*-*- In this mod I have a string system called modstring. I substitue it for get_string. I have all the strings for the mod at the bottom, so you can add them to any external string from english.str or other modded extras. Note that - indicates existing code, and + is new or modified code. Remember to take the + out if you are block reading stuff: First Back up your Source!!!! I can't stress how important this is especially in a big mod like this! First load FCNS.H. Add these two lines under UTILITY.C: - void write_user(unsigned int un, userrec *u); + void read_note(unsigned int un); /* mod - add */ + void write_note(unsigned int un); /* mod - add */ - int open_qscn(void); Save FCNS.H. Now load VARS.H and add the definition for the user note to the __EXTERN__ char section: + ver_no2[51],wwiv_net_no[20], xdate[9], *xenviron[50], /*replace ; with,*/ + unote[81]; /*add unote [81] and ; */ Save VARS.H. Then load UTILITY.C, and add the following line at the top: - #include VARS.H + extern char unote[81]; /* mod - add */ Search for void write_user(unsigned int un, userrec *u), and add these two new voids immediately afterward: + void read_note(unsigned int un) /* mod - add entire void */ + { + long pos; + char s[80]; + int f,i; + + sprintf(s,"%sUCOMMENT.DAT",syscfg.datadir); + if (!exist(s)) { + strcpy(unote,"Change Me!!!"); + f=open(s,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE); + for (i=0; i<=syscfg.maxusers; i++) { + pos=(81L * (long) i); + lseek(f,pos,SEEK_SET); + write(f,(void *) unote, 81L); + } + } else { + f=open(s,O_RDWR | O_BINARY); + pos=(81L * (long) un); + lseek(f,pos,SEEK_SET); + read(f,(void *) unote, 81L); + } + close(f); + } + + void write_note(unsigned int un) /* mod - add entire void */ + { + long pos; + char s[80]; + int f,i; + + sprintf(s,"%sUCOMMENT.DAT",syscfg.datadir); + f=open(s,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE); + pos=(81L * (long) un); + lseek(f,pos,SEEK_SET); + write(f,(void *) unote, 81L); + close(f); + } Save UTILITY.C. Now in NEWUSER.C, add the line at the top: - #include VARS.H + extern char unote[81]; /* mod - add */ Then right before void newuser(void), add the following void: + void input_usernotea(void) + { + char s[81]; + + nl(); + pl("Enter a Usernote, a line that will appear in messages by you, below your"); + pl("name. Use it as a comment that you want other users to see. You can change"); + pl("it in the Defaults section at any time."); /*You could take this */ + nl(); /*out and chane to to a*/ + read_note(usernum); /*print file */ + npr("2%s0%s\r\n",modstring(1),unote); /*Change the modstring if needed*/ + prt(2,modstring(2)); + ansic(0); + s[0]=0; + inli(s,s,60,1); + if (s[0]) { + strcpy(unote,s); + write_note(usernum); + } + } Next search down to void newuser, and add the following code to initialize the note for new users: - } while (((u.inact & inact_deleted)==0) && ((long)usernum<=l1)); - } - write_user(usernum,&thisuser); + strcpy(unote,"Change Me!!!"); /* mod - add */ + write_note(usernum); /* mod - add */ + input_usernotea(); - close_user(); Save NEWUSER.C. Then, in DEFAULTS.C, add this line at the top: - #include VARS.H + extern char unote[81]; Next, in DEFAULTS.C, add the following line in void print_cur_stat: - outstr(get_string(400)); npr("%d\r\n",thisuser.optional_val); + read_note(usernum); + outstr(modstring(4)); npr("%s\r\n",unote); - outstr(get_string(401)); - if (thisuser.wwiv_regnum); Then search for void defaults, and add the "C" to the prt and onek statements. Depending on what else you may have added, there may be some difference between what is printed here and what you have. All you need to do is add the C to the four lines: - if (okansi()) { + prt(2,get_string(477)); /* edit string 477 */ + ch=onek("Q?123456789ABCS"); /* mod - change */ - } else { + prt(2,get_string(478)); /* edit string 478 */ + ch=onek("Q?1234567BCS"); /* mod - change */ - } And near the bottom of the void, right below case 'B': - break; + case 'C': /* mod - add */ + nl(); /* mod - add */ + read_note(usernum); /* mod - add */ + npr("2%s0%s\r\n",modstring(1),unote); /* mod - add */ + prt(2,modstring(2)); /* mod - add */ + ansic(0); /* mod - add */ + s[0]=0; /* mod - add */ + inli(s,s,60,1); /* mod - add */ + if (s[0]) { /* mod - add */ + strcpy(unote,s); /* mod - add */ + write_note(usernum); /* mod - add */ + } /* mod - add */ + break; /* mod - add */ - case 'W': - enter_regnum(); Save DEFAULTS.C Then load UEDIT.C, and add this line at the top: - #include VARS.H + extern char unote[81]; /* mod - add */ Next, search for void print_data(..). Add the following code to display the user's note: - if (u->note[0]) { - outstr(get_string(253)); pl(u->note); - } + read_note(un); /* must be un, dont change! */ /* mod - add */ + npr("%s%s\r\n",modstring(3),unote); /* mod - add */ - if (u->ass_pts) { Now find void uedit(...). Add the variable X to the command line (and you may want to update the menus to show that X is update the user's comment) and add the code to edit the comment. Also note you may not have all the other letters there - just add the X at the end: - prt(2,get_string(266)); - if ((realsl==255) || (wfc)) + ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAIHB$KW~^:X"); /* mod - change */ - else + ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAIHB$KW^X"); /* mod - change */ - switch(ch) { Now add the case 'X', right before case ':': - } - break; + case 'X': /* mod - add */ + nl(); /* mod - add */ + prt(2,modstring(2)); /* mod - add */ + ansic(0); /* mod - add */ + s[0]=0; /* mod - add */ + inli(s,s,60,1); /* mod - add */ + if (s[0]) { /* mod - add */ + strcpy(unote,s); /* mod - add */ + write_note(un); /* mod - add */ + } /* mod - add */ + break; /* mod - add */ - case ':': Save UEDIT.C. Now load MSGBASE.C, and again add the following line at the top: - #include VARS.H + extern char unote[81]; /* mod - add */ Then search for void read_message1(...), and add the following lines: - if (origin_str[0]) { - osan(get_string(662),&abort,next); - plan(origin_str,&abort,next); - } + if (unote[0]) { /* mod - add */ + osan(modstring(5),&abort,next); /* mod - add */ + plan(unote,&abort,next); /* mod - add */ + } /* mod - add */ - break; - case anony_sender: And in void read_message(...): - if ((lcs()) || (ss.ability & ability_read_post_anony)) - a=1; - else - a=0; - setorigin(p.ownersys, p.owneruser); + if (p.ownersys==0) /* mod - add */ + read_note(p.owneruser); /* mod - add */ + else /* mod - add */ + unote[0]=0; /* mod - add */ - readmessage1(.....) Save MSGBASE.C. Next to last, load MSGBASE1.C and add the external variable declaration: - #include VARS.H + extern char unote[81]; /* mod - add */ Then in void readmail(void): - setorigin(m.fromsys, m.fromuser); + if (m.fromsys==0) /* mod - add */ + read_note(m.fromuser); /* mod - add */ + else /* mod - add */ + unote[0]=0; /* mod - add */ - if (!abort) - read_message1(&m.msg, (m.anony & 0x0f), i, &next, "EMAIL"); Save MSGBASE1.C. Finally, load SYSOPF.C and the external variable declaration: - #include VARS.H + extern char unote[81]; /* mod - add */ Then in void mailr(void): - outstr(get_string(326)); pl(m.title); - setorigin(m.fromsys, m.fromuser); + if (m.fromsys==0) /* mod - add */ + read_note(m.fromuser); /* mod - add */ + else /* mod - add */ + unote[0]=0; /* mod - add */ - read_message1(&(m.msg),m.anony & 0x0f,1,&next,"EMAIL"); - prt(2,get_string(327)); Save SYSOPF.C. That's it. You'll have to recompile the board since FCNS.H and VARS.H have been changed. Now, the first time you log on as new or enter defaults, the user comment will be created. The users can then customize the comment to whatever they want, and anytime a message that they wrote is read, their current comment will be displayed. If you have any questions, comments or problems with this mod, I can be reached at 1@17315 or via the WWIVLink Mod Discussion sub. Oh, here are the modstring files. Modstrings list, although can be put into anything: 1: "Current User Comment : " 2: "New Comment : " 3: "Cmnt: " 4: "C. User Comment : " 5: "Note: " Till next mod, Cya. 7Tanis 5The Half-Elven