Code |
<script type="text/javascript"> function age(a){ if (!a){return '';} // Get Current Date var now = new Date(); var y = now.getYear(); var m = now.getMonth()+1; var d = now.getDate(); if (!y){return '';} // Split User's Birthday aa=a.match(/^([0-9]+)-([0-9]+)-([0-9]+)/); if (!aa[1]){return '';} // Get User's Age var age = y-aa[1]; if (m==aa[2] && d<aa[3]){age--;} else if (m<aa[2]){age--;} return age; } </script> |
это вставляю в <head></head> форума
а это
Code |
<script type="text/javascript">document.write(age('$USER_BIRTHDAY$'));</script> |
в шаблоне сообщений после Статуса
И чего-та ни хрена не выходит, мож не туда вставляю