2

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?

6

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.)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.