captcha_5_posts.naml

<override_macro name="reply_form">
    <n.if.not.visitor.is_registered>
        <then.anonymous_name_control/>
    </n.if.not.visitor.is_registered>
    
    <n.subject_control/>
    <n.message_control/>
    
    <n.if.either condition1="[n.not.visitor.is_registered/]" condition2="[n.needs_captcha/]">
        <then.captcha_control/>
    </n.if.either>
</override_macro>

<override_macro name="check_recent_post_limit" requires="node_page">
    <n.if.needs_captcha>
        <then.check_captcha/>
    </n.if.needs_captcha>
</override_macro>

<macro name="needs_captcha">
    <n.either>
        <condition1.visitor.has_too_many_posts/>
        <condition2.regex_matches text="[n.visitor.node_count/]" pattern='^[01234]$'/>
    </n.either>
</macro>