Is it possible to limit the amount of entries that a user can post. For example, if users are posting entries to a channel via a safecracker form, can I limit them to a single entry?
1 Answer
How would you want to enforce the limit? You could use a query tag at the top of the Safecracker form:
{exp:query sql="Select count(*) 'number_posts' from exp_channel_titles where author_id='{member_id}'"}
{if number_posts == 1}{/if}
{/exp:query}
And within that query, you could do a redirect, display a message, or wrap the whole form in a conditional that wouldn't display it if the user had > 1 result.
You could also only enable the form if number_posts < 1
, and then in the else case redirect to an edit form for their single entry.
(Might not be the right syntax for author/member -- You'll need to look up the actual tags for those.)
-
I'll save you the trouble of looking it up. ;) See
total_entries
– Alex Kendrick ♦Commented Jan 28, 2013 at 15:20