|
|
|||||||
I want to send a message of the day as a pop up message on login at a school split across two sites. We need to have different messages for different groups of students/staff/locations. My idea was to create a folder available to staff for them to add text files to, one message per file. This way I can expire files based on their date so that we don't get old messages appearing. Does anyone have anything vaguely similar I could build on? ChrisJ |
||||||||
|
|
|||||||
There are alot of different ways this could be done. Off the top of my head... Create your folders Then to present random messages from that folder, build an array that contains the message file names. At random pick one of the messages Then using @Site (assuming that you have AD and there are two seperate sites) put the contents of the selected message into a messagebox. Here is a logic flow, not by any means a working script Code:
|
||||||||
|
|
|||||||
Garg; Doesn't MessageBox sit and wait for userinteraction before script execution continues? If it does it could prove a 'problem'. |
||||||||
|
|
|||||||
Provide the 4th MessageBox parameter, Time-Out in seconds. I presume to have really random MOTD's you will want to use SRnd() ? I thought I read somewhere that using Rnd() without SRnd() does not really generate randoms. |
||||||||
|
|
|||||||
Quote: Yep it does but is also has a timeout option. |
||||||||
|
|
|||||||
Don't use RND. Use a modulo of the date, which will ensure different MOTD each day, but the same MOTD for eveyone on that day. This came up only recently, so search recent posts for the solution. |
||||||||
|
|
|||||||
You could setup a message of the day source file in ini format. This way it will be quite easy to read the message for that day. |
||||||||
|
|
|||||||
Quote: But the timer stops if focus is lost. While I am a staunch believer that logon scripts should neither be seen nor heard, if you really do want to annoy users, at least separate the message from the script by spawning it in the web browser. Users tend to view the message as just slowing them down during logon and will simply stop logging off. |
||||||||
|
|
|||||||
Here is that discussion thread I referred to: http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=162749&an=&page=&vc=1 |
||||||||
|
|
|||||||
Quote: Me too |
||||||||
|
|
|||||||
Quote: Care to explain how this is done? |
||||||||
|
|
|||||||
If you read the rest of his post, he goes on to say "This came up only recently, so search recent posts for the solution". How hard can it be? http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Board=UBB1&Number=162841 |
||||||||
|
|
|||||||
Yes how to implement it, but not the how the modulus works, for those of us without a major in mathematics, it can be difficult to understand without the plain english explanation. |
||||||||
|
|
|||||||
Another idea, change the IE home page if possible. Or just start an IE session pointing to the right page.... ie, http://intranet/2006-09-22.htm Or perhaps there isn't any need for formatting etc? |
||||||||
|
|
|||||||
No, I meant the searching bit. |
||||||||
|
|
|||||||
Quote: The link provided gives a working script. As for the maths, it's very simple. You start with a big number (let's call it D), divide by a smaller number (lets call it Q) and take the remainder. The remainder is always going to be between 0 and Q-1. As D increases by 1, so the remainder will increase by 1. This remainder is also known as the modulus. Here is an example. Lets start D and Q both at 3 and see what the effect of increasing D is: Quote: So how does this help? Well, assume that "D" represents Date, and "Q" represents "Quotes". This gives us a really simple way of going through the quotes in a linear fashion. All you need to do is get the date in a numeric format. There are a number of "serial date" functions to convert dates into an internal format that you can use in maths, but you don't really need them. Here is one very simple way of determining the quote: Code: Break ON See, I told you it was simple The only drawback to using this method is that some quotes will be skipped on each cycle, however they will be picked up in later cycles so it is not an issue unless you are paranoid about all your quotes being displayed. Don't forget that the result is between 0 and Q-1. |
||||||||
|
|
|||||||
Ok, I think I get the jist of it. Thanks for putting up with me |