Re: Limit number of posts
Posted by
Pedro on
Oct 19, 2014; 10:41pm
URL: https://support.nabble.com/Limit-number-of-posts-tp7591916p7592055.html
Here is the code to make the reply link disappear when someone from the
Spam group posts more then 2 replies in a day:
<macro name="user_request">
<script type="text/javascript">
var posts_today;
var path = '/template/NamlServlet.jtp?macro=user_response&user=';
var url = Nabble.userId;
$.getScript(path+url+Nabble.getClientID() ,function(data){
posts_today = data;
if(posts_today > 2){
$('.reply_link').css('display','none');
}
});
</script>
</macro>
<macro name="user_response">
<n.if.user_from_get.is_in_group group="Spam" >
<then>
<n.user_from_get.node_count filter = "date_part('day',now() - when_created) = 0 "/>
</then>
</n.if.user_from_get.is_in_group>
</macro>
What should I do?