You could try
Code:
<if condition="$thread['lastpost'] < (TIMENOW - (365 * 86400))">
// warning message
</if>
But whether it works or not may depend on which template you put it in.
ETA...I tried it in "threadbit". Also, you might also want to enclose it in another if to check to make sure that $thread['lastpost'] is set, so that in case it isn't the message won't show up.