• JS Formatting

    From DesotoFireflite@VERT/VALHALLA to All on Sun Jul 10 07:24:42 2022
    I added a message option to send me an email everytime a new user was verified by the emailvar.js. It's working correctly, and I'm very satisfied with my efforts to make it work. The message it send to my email is as follows:ãã-+- Snipit ----ãmsgtxt = "New Member, Alias: " + user.alias + ", #: " + String(user.number) + ", Joined " + system.name + " Today " + (new Date());ã-+- Snipit ----ããexpands as follows in the message:ããNew Member, Alias: Tuff, #: 191, Joined Valhalla Home Services Today Sun Jul 10 7:15:32ããI would rather it to be somewhat like this:ããNew Member Joined Valhalla Home Services Today Sun Jul 10 7:15:32.ãã Alias: Tuffã Number: 191ããIs there a way to do this. For the like of me, I can't find a way to do this formatting. I'm successful in doing it in one line, but I'm trying to learn more. Thanks in advance.ããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.com:23ãA Gamers Paradise - Over 250 Registered Online Game Doors!ãã--- Don't eat the yellow snow!ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã
  • From Digital Man@VERT to DesotoFireflite on Sun Jul 10 14:40:26 2022
    Re: JS Formattingã By: DesotoFireflite to All on Sun Jul 10 2022 07:24 amãã > I added a message option to send me an email everytime a new user wasã > verified by the emailvar.js. It's working correctly, and I'm very satisfiedã > with my efforts to make it work. The message it send to my email is asã > follows:ã >ã > -+- Snipit ----ã > msgtxt = "New Member, Alias: " + user.alias + ", #: " + String(user.number)ã > + ", Joined " + system.name + " Today " + (new Date());ã > -+- Snipit ----ã >ã > expands as follows in the message:ã >ã > New Member, Alias: Tuff, #: 191, Joined Valhalla Home Services Today Sun Julã > 10 7:15:32ã >ã > I would rather it to be somewhat like this:ã >ã > New Member Joined Valhalla Home Services Today Sun Jul 10 7:15:32.ã >ã > Alias: Tuffã > Number: 191ã >ã > Is there a way to do this. For the like of me, I can't find a way to do thisã > formatting. I'm successful in doing it in one line, but I'm trying to learnã > more. Thanks in advance.ããmsgtxt = "New Member Joined " + system.name + " Today " + new Date() + ".\r\n";ãmsgtxt += "\r\n Alias: " + user.alias;ãmsgtxt += "\r\n Number: " + user.number;ãmsgtxt += "\r\n";ã-- ã digital man (rob)ããBreaking Bad quote #37:ãonly the very best... with just a right amount of dirty. - SaulãNorco, CA WX: 89.7øF, 33.0% humidity, 17 mph S wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Sun Jul 10 19:50:19 2022
    Re: JS Formattingã By: Digital Man to DesotoFireflite on Sun Jul 10 2022 02:40 pmãã DM> Re: JS Formattingã DM> By: DesotoFireflite to All on Sun Jul 10 2022 07:24 amãã >> I added a message option to send me an email everytime a new user wasã >> verified by the emailvar.js. It's working correctly, and I'm veryã >> satisfied with my efforts to make it work. The message it send to myã >> email is as follows:ãã >> -+- Snipit ----ã >> msgtxt = "New Member, Alias: " + user.alias + ", #: " +ã >> String(user.number) + ", Joined " + system.name + " Today " + (newã >> Date()); -+- Snipit ----ãã >> expands as follows in the message:ãã >> New Member, Alias: Tuff, #: 191, Joined Valhalla Home Services Todayã >> Sun Jul 10 7:15:32ãã >> I would rather it to be somewhat like this:ãã >> New Member Joined Valhalla Home Services Today Sun Jul 10 7:15:32.ãã >> Alias: Tuffã >> Number: 191ãã >> Is there a way to do this. For the like of me, I can't find a way toã >> do this formatting. I'm successful in doing it in one line, but I'mã >> trying to learn more. Thanks in advance.ãã DM> msgtxt = "New Member Joined " + system.name + " Today " + new Date() +ã DM> ".\r\n"; msgtxt += "\r\n Alias: " + user.alias;ã DM> msgtxt += "\r\n Number: " + user.number;ã DM> msgtxt += "\r\n";ããWOW, that was simple enough. I had no idea you could do it this way, but after looking at it, it makes perfect sense.ããI wish there was a tips and tricks info site on js, that I could explore.ããThanks again for the assist.ããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.com:23ãA Gamers Paradise - Over 250 Registered Online Game Doors!ãã--- Don't eat the yellow snow!ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã
  • From Digital Man@VERT to DesotoFireflite on Mon Jul 11 11:15:08 2022
    Re: JS Formattingã By: DesotoFireflite to Digital Man on Sun Jul 10 2022 07:50 pmãã > Re: JS Formattingã > By: Digital Man to DesotoFireflite on Sun Jul 10 2022 02:40 pmã >ã > DM> Re: JS Formattingã > DM> By: DesotoFireflite to All on Sun Jul 10 2022 07:24 amã >ã > >> I added a message option to send me an email everytime a new user wasã > >> verified by the emailvar.js. It's working correctly, and I'm veryã > >> satisfied with my efforts to make it work. The message it send to myã > >> email is as follows:ã >ã > >> -+- Snipit ----ã > >> msgtxt = "New Member, Alias: " + user.alias + ", #: " +ã > >> String(user.number) + ", Joined " + system.name + " Today " + (newã > >> Date()); -+- Snipit ----ã >ã > >> expands as follows in the message:ã >ã > >> New Member, Alias: Tuff, #: 191, Joined Valhalla Home Services Todayã > >> Sun Jul 10 7:15:32ã >ã > >> I would rather it to be somewhat like this:ã >ã > >> New Member Joined Valhalla Home Services Today Sun Jul 10 7:15:32.ã >ã > >> Alias: Tuffã > >> Number: 191ã >ã > >> Is there a way to do this. For the like of me, I can't find a way toã > >> do this formatting. I'm successful in doing it in one line, but I'mã > >> trying to learn more. Thanks in advance.ã >ã > DM> msgtxt = "New Member Joined " + system.name + " Today " + new Date() +ã > DM> ".\r\n"; msgtxt += "\r\n Alias: " + user.alias;ã > DM> msgtxt += "\r\n Number: " + user.number;ã > DM> msgtxt += "\r\n";ã >ã > WOW, that was simple enough. I had no idea you could do it this way, butã > after looking at it, it makes perfect sense.ã >ã > I wish there was a tips and tricks info site on js, that I could explore.ããHere are some for this particular topic:ãhttps://www.w3schools.com/js/js_strings.aspãhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Stringãã > Thanks again for the assist.ããNo problem.ã-- ã digital man (rob)ããSling Blade quote #8:ãKarl Childers: I don't reckon I got no reason to kill nobody.ãNorco, CA WX: 80.4øF, 49.0% humidity, 2 mph E wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Tracker1@VERT/TRN to DesotoFireflite on Sat Jul 16 14:24:15 2022
    On 7/10/22 04:24, DesotoFireflite wrote:

    I would rather it to be somewhat like this:

    New Member Joined Valhalla Home Services Today Sun ...

    Alias: Tuff
    Number: 191

    var msg = [
    "New member joined..." + new Date().toString(),
    "",
    "Alias: " + user.alias,
    "Number: " + String(user.number)
    ].join("\r\n");
    --
    Michael J. Ryan - tracker1@roughneckbbs.com
    ---
    ï¿­ Synchronet ï¿­ Roughneck BBS - roughneckbbs.com
  • From DesotoFireflite@VERT/VALHALLA to Tracker1 on Sun Jul 17 09:02:16 2022
    Re: Re: JS Formattingã By: Tracker1 to DesotoFireflite on Sat Jul 16 2022 02:24 pmãã Tr> On 7/10/22 04:24, DesotoFireflite wrote:ãã >> I would rather it to be somewhat like this:ãã >> New Member Joined Valhalla Home Services Today Sun ...ãã >> Alias: Tuffã >> Number: 191ãã Tr> var msg = [ã Tr> "New member joined..." + new Date().toString(),ã Tr> "",ã Tr> "Alias: " + user.alias,ã Tr> "Number: " + String(user.number)ã Tr> ].join("\r\n");ããI decided to go with this below. Since it was your program "emailval.js" to begin with, I wanted a simple way of sending the sysop a message letting him/her that a new user had joined, and was validated. This gives me a quick snapshot of their info. I know it's overkill, but at least it gives me an idea whats going on without having to real logs. In time, I'll add to it those users that failed the validation process. ãã msgbase = new MsgBase("mail");ã if(msgbase.open()==false) {ã log(LOG_ERR,"!ERROR " + msgbase.error);ã return(false);ã }ãã hdr = { ã to: system.operator, ã to_ext: "1",ã from: user.alias, ã from_ext: String(user.number),ã attr: MSG_KILLREAD,ã subject: "New Member To " + system.name + "!" ã };ãã msgtxt = "New Member Joined " + system.name + " On " + new Date() + ".\r\n";ã msgtxt += "\r\n Name & Alias..: " + "Alias: " + user.alias + ", " + " Real Name: " + user.name;ã msgtxt += "\r\n Number........: " + user.number;ã msgtxt += "\r\n Handle........: " + user.handle;ã msgtxt += "\r\n Birthdate.....: " + user.birthmonth + "/" + user.birthday + "/" + user.birthyear;ã msgtxt += "\r\n Location......: " + user.location;ã msgtxt += "\r\n IP Address....: " + user.ip_address;ã msgtxt += "\r\n Email Address.: " + user.netmail;ã msgtxt += "\r\n Gender (M/F/X): " + user.gender;ã msgtxt += "\r\n";ã ã var result = msgbase.save_msg(hdr, msgtxt);ã if(!result)ã log(LOG_ERR, "!ERROR " + msgbase.error + " saving mail message");ãã msgbase.close();ã return result;ããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.com:23ãA Gamers Paradise - Over 250 Registered Online Game Doors!ãã--- I'm so disorganized my keyboard isn't even in alphabetical order!ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã
  • From Rampage@VERT/SESTAR to DesotoFireflite on Mon Jul 18 06:00:22 2022
    Re: Re: JS Formattingã By: DesotoFireflite to Tracker1 on Sun Jul 17 2022 09:02:16ãããreadability is a thing...ãã > msgtxt = "New Member Joined " + system.name + " On " + new Date() + ".\r\n";ã > msgtxt += "\r\n Name & Alias..: " + "Alias: " + user.alias + ", " + " Real Name: " + user.name;ã > msgtxt += "\r\n Number........: " + user.number;ã > msgtxt += "\r\n Handle........: " + user.handle;ã > msgtxt += "\r\n Birthdate.....: " + user.birthmonth + "/" + user.birthday + "/" + user.birthyear;ã > msgtxt += "\r\n Location......: " + user.location;ã > msgtxt += "\r\n IP Address....: " + user.ip_address;ã > msgtxt += "\r\n Email Address.: " + user.netmail;ã > msgtxt += "\r\n Gender (M/F/X): " + user.gender;ã > msgtxt += "\r\n";ããwhile the above is easy to read, i expect the EOL sequences to be at the end of the line... for blank lines, i place the EOL sequence on a line by itself... the above i would write like this...ãã msgtxt = "New Member Joined " + system.name + " On " + new Date() + ".\r\n";ã msgtxt += "\r\n";ã msgtxt += " Name & Alias..: " + "Alias: " + user.alias + ", " + " Real Name: " + user.name + "\r\n";ã msgtxt += " Number........: " + user.number + "\r\n";ã msgtxt += " Handle........: " + user.handle + "\r\n";ã msgtxt += " Birthdate.....: " + user.birthmonth + "/" + user.birthday + "/" + user.birthyear + "\r\n";ã msgtxt += " Location......: " + user.location + "\r\n";ã msgtxt += " IP Address....: " + user.ip_address + "\r\n";ã msgtxt += " Email Address.: " + user.netmail + "\r\n";ã msgtxt += " Gender (M/F/X): " + user.gender + "\r\n";ã msgtxt += "\r\n";ããthis makes it much easier to see each output line in the code... hopefully wrapping won't fark it up too badly...ããã)\/(arkãã---ã þ Synchronet þ The SouthEast Star Mail HUB - SESTARã
  • From DesotoFireflite@VERT/VALHALLA to Rampage on Mon Jul 18 08:19:53 2022
    Re: Re: JS Formattingã By: Rampage to DesotoFireflite on Mon Jul 18 2022 06:00 amãã Ra> Re: Re: JS Formattingã Ra> By: DesotoFireflite to Tracker1 on Sun Jul 17 2022 09:02:16ããã Ra> readability is a thing...ããI do understand what you are saying, and there are different ways to acheve the same thing. I see what you did in your scenaro, and I agree it will work, but the way I did it works also. It's just a matter of working style. I can read both ways equally as well, and know what is going on. On my final code, I always put notes in the file to refresh my memory as to what the code was supposed to do, so after time, I won't have to figure it out again. I do find sometimes, after time, I didlike what I do, and go back and change it or tweak it a bit. All and all, the most important thing is, is that it works without undue stress on the system. ããI do appreciate your input, as I'm still learning, and evey comment does help. ThanksããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.com:23ãA Gamers Paradise - Over 250 Registered Online Game Doors!ãã---ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã