jscar wrote:OK, thanks for that. Really appreciate your help on this.
You're welcome!
jscar wrote:What language are those functions written in?
Just a simple/basic one that I created for
CSE HTML Validator. I just call it the "tag name programming language".
Please try this.
1. Create a file named "jscar.cfg" (or pick your own filename).
2. Copy this to it:
- Code: Select all
function onStartTag_meta() {
if hasAttWithStringValue('name','Date.Modified') {
if hasAtt('content') {
$contentvalue=getAttValue(getAttIndex('content'));
$docyear=getMidString($contentvalue,0,4);
$docmonth=getMidString($contentvalue,5,2);
$docday=getMidString($contentvalue,8,2);
#year=getValueInt(100);
#month=getValueInt(101);
#day=getValueInt(102);
#docdate=(#docyear*365)+(#docmonth*31)+#docday;
#todaydate=(#year*365)+(#month*31)+#day;
if (#todaydate-#docdate)>30 {
MessageEx(1033,MSG_MESSAGE,'Document date is '+$docyear+'-'+$docmonth+'-'+$docday+', which is old enough to be checked.');
}
else {
MessageEx(1033,MSG_MESSAGE,'Document date is '+$docyear+'-'+$docmonth+'-'+$docday+', which is new enough not to be checked.');
setFlag(2,2,0); // don't show future comments
setFlag(2,8,0); // don't show future warnings
setFlag(2,0x400,0); // don't show future messages
setFlag(2,0x1000000,0); // don't show future errors
}
}
}
}
3. Goto
Options->Validator Engine Options->Options and then
Validator Engine->Config File. Set the user function file to jscar.cfg.
4. Reload the configuration and it should be active.
What it should do is just disable future comments, warnings, and messages if the document is less than about 30 days old.
If you're interested, this can be improved and I'd be happy to work on this if you'd like to test a BETA version of v12. If so, then let me know how you'd like to see this improved. Some of my thoughts are easier to use functions to get the current year, month, and day. There could also be a new function to clear the messages that have been generated up to the point where the future ones are disabled, because currently it doesn't affect the messages that have already been generated (if any).