Hi fellow sysops,
Can anyone send me in the right direction to show a message, screen or so when an user logon on a particular date?
For eg on 1 february for valentine's day, 1 april for april foolsday, etc...
Thanks for thinking with me.
Or just a few lines of JavaScript added to your logon.js:
var datefile = system.text_dir + format("%02u%02u.asc"
, new Date().getMonth(), new Date().getDate());
if(file_exists(datefile))
console.printfile(datefile);
Re: Show message or screen on logon on particular date
By: Digital Man to Hawkeye on Fri Apr 06 2018 23:47:01
Or just a few lines of JavaScript added to your logon.js:
var datefile = system.text_dir + format("%02u%02u.asc"
, new Date().getMonth(), new Date().getDate());
if(file_exists(datefile))
console.printfile(datefile);
Thanks! I first didn't see/find this post, which was weird as I logged in every day to check out new posts.
I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.
Also logged in with other user than myself, a test user. Rebooted, restarted, etc...
Synchronet "Real Fact" #35:
The irc.synchro.net network has more servers than users.
Digital Man wrote to Hawkeye on 04-12-18 20:52 <=-
Re: Show message or screen on logon on particular date
By: Hawkeye to Digital Man on Thu Apr 12 2018 10:06 pm
Re: Show message or screen on logon on particular date
By: Digital Man to Hawkeye on Fri Apr 06 2018 23:47:01
Or just a few lines of JavaScript added to your logon.js:
var datefile = system.text_dir + format("%02u%02u.asc"
, new Date().getMonth(), new Date().getDate());
if(file_exists(datefile))
console.printfile(datefile);
Thanks! I first didn't see/find this post, which was weird as I logged in every day to check out new posts.
I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.
Just print the file name (datefile) to the terminal user (e.g. using alert() or print()) or log it (using log()) to find out why.
Also logged in with other user than myself, a test user. Rebooted, restarted, etc...
You don't need to do any of those things.
var datefile = system.text_dir + format("%02u%02u.asc"
, new Date().getMonth(), new Date().getDate());
if(file_exists(datefile))
console.printfile(datefile);
I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.
Re: Show message or screen on logon on particular date
By: Digital Man to Hawkeye on Thu Apr 12 2018 20:52:42
Synchronet "Real Fact" #35:
The irc.synchro.net network has more servers than users.
wow haha.
Hiya Rob...
Digital Man wrote to Hawkeye on 04-12-18 20:52 <=-
Re: Show message or screen on logon on particular date
By: Hawkeye to Digital Man on Thu Apr 12 2018 10:06 pm
Re: Show message or screen on logon on particular date
By: Digital Man to Hawkeye on Fri Apr 06 2018 23:47:01
Or just a few lines of JavaScript added to your logon.js:
var datefile = system.text_dir + format("%02u%02u.asc"
, new Date().getMonth(), new Date().getDate());
if(file_exists(datefile))
console.printfile(datefile);
Thanks! I first didn't see/find this post, which was weird as I logged in every day to check out new posts.
I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.
Just print the file name (datefile) to the terminal user (e.g. using alert() or print()) or log it (using log()) to find out why.
Also logged in with other user than myself, a test user. Rebooted, restarted, etc...
You don't need to do any of those things.
I've been following this thread and have been updating my logon.js as well. I was getting the same results as Hawkeye so I added the alert() as you suggested. Interesting results. Here is the message I received: c:\sbbs\text\0313.asc
It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.
Your thoughts?
var datefile = system.text_dir + format("%02u%02u.asc"
, new Date().getMonth(), new Date().getDate());
It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.
Android8675 wrote to Bill McGarrity on 04-13-18 09:25 <=-
Re: Show message or screen on logon on particular date
By: Bill McGarrity to Digital Man on Fri Apr 13 2018 09:47 am
var datefile = system.text_dir + format("%02u%02u.asc"
, new Date().getMonth(), new Date().getDate());
It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.
Change the "new Date().getMonth()" part and add a +1 (January might =
0)
var datefile = system.text_dir + format("%02u%02u.asc", new Date().getMonth()+1, new Date().getDate());
Digital Man wrote to Bill McGarrity on 04-13-18 11:06 <=-
I've been following this thread and have been updating my logon.js as well. I was getting the same results as Hawkeye so I added the alert() as you suggested. Interesting results. Here is the message I received: c:\sbbs\text\0313.asc
It seems it's looking for the wrong file. Now I'm no expert but could there be an issue with the 'format' statement? My computer clock is reading April 13, 2018.
Your thoughts?
Ah, good catch. The month is zero-based: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Object
s/Date/getMonth
Just add "+1" after the call to getMonth().
I add this in my logon.js, at the end and also tried in the beginning. Placed an ascii file named 0412.asc in c:\sbbs\text but it doesn't show up.
You don't need to do any of those things.
digital man
Add the 2 lines in the middle, it'll display the filename it's attempting to print out, it's possible the filename may not have leading zeroes like 412.asc instead of 0412.asc
Android8675@ShodansCore
Thanks a lot for you patience and help. As (extra) appreciation I sent a small donation to your paypal. Good software deserves support, always.
| Sysop: | Winzlo |
|---|---|
| Location: | Minnesota, USA |
| Users: | 11 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 495937:12:24 |
| Calls: | 82 |
| Files: | 1,070 |
| D/L today: |
27 files (11,920K bytes) |
| Messages: | 286,955 |