expire_old_threads.naml

<override_macro name="reply" requires="servlet">
	<n.node_page.>
		<n.if.page_node.when_created.is_older_than days="[n.thread_expiration_days/]">
			<then.redirect_to.expired_thread_page_path/>
			<else.overridden/>
		</n.if.page_node.when_created.is_older_than>
	</n.node_page.>
</override_macro>

<macro name="thread_expiration_days">
	365
</macro>

<macro name="expired_thread_page_path" requires="node_page">
	/template/NamlServlet.jtp?macro=expired_thread_page&node=<n.page_node.id/>
</macro>

<macro name="expired_thread_page" requires="servlet">
	<n.node_page.>
		<n.html>
			<head>
				<title><t>This thread is read-only</t></title>
			</head>
			<body>
				<h1><t>This thread is read-only</t></h1>

				<p>
					<t>This topic was created a long time ago and a new reply here would be confusing to a lot of people.</t><br/>
					<t>If you have questions about this subject, please <a href="[n.page_node.get_app_node.new_topic_path/]">create a new topic</a> and link to this thread if needed.</t>
				</p>
				<p>
					&laquo; <a href="[n.page_node.path/]">Go back</a>
				</p>
			</body>
		</n.html>
	</n.node_page.>
</macro>