I there a way to restrict the number of entries by a user to one active entry at a time?
I'd love to create some kind of freemium model for my classifieds site, which only allows for one active ad by any free user.
I there a way to restrict the number of entries by a user to one active entry at a time?
I'd love to create some kind of freemium model for my classifieds site, which only allows for one active ad by any free user.
Are you using a SAEF to let people post the classified ad? If so you can use conditionals to check to see if that user has an entry already. Something like:
{exp:channel:entries channel="classified_ads" author_id="CURRENT_USER" dynamic="no"}
{if no_results}
{embed="_forms/.saef_form"}
{/if}
{if count == 1}
You currently have an active classified ad.
{/if}
{/exp:channel:entries}
You could also drill down further with conditionals and check for an entry over a specific time period, for example, within the last day:
{if "{entry_date format='%Y%m%d'}" != "{current_time format='%Y%m%d'}"}
If you are having your members add entries by safecracker this shouldn't be too tough. You would just need to restrict them from publishing to safecracker by how many entries they have.
Just test if you have a valid entry, if not show the form, if so then show a message saying they can only have one entry at a time.
Brad