• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Answered Display message to user when hit ad limit for group

ValidHorseChewer

New Member
CAS Premium
LD Premium
You can set a limit on the number of open ads per user group.

If the user has reached this limit, currently, it just hides the "Post Ad" button link.

I would like to be able to display a message to the user to tell them that they have reached the limit, and pretty please, would they like to upgrade?

xa_cas_category_view has this code:

<xf:pageaction if="$category.canPostAd()">
<xf:button href="{{ link('cas/categories/add', $category) }}" class="button--cta" icon="add">
{{ $category.content_term ? phrase('xa_cas_post_x_ad', {'term': $category.content_term|to_lower}) : phrase('xa_cas_post_ad') }}
</xf:button>
</xf:pageaction>

I am wondering if there is a way to test in the template whether or not the user has reached their groups ad limit.

I've dumped $cateogory, $xf.visitor and $xf.options. But I don't think they have the info I need. I have bozz eyes, they're big dumps!
 
The canPostAd() function is MUCH MORE than just checking to see if the users ad count has been exceded, there are other factors in that function that determine whether the viewing user can post an ad in that category.

There currently is NOT a function that only determines whether the use can post an ad based on reaching the max ad count in that category.

You are more than welcome to start a thread in the CAS Suggestions forum asking for a function that is solely for determining whether the viewing user can post an ad in a specific category based on Max Open Ad Count.
 
Back
Top