Hi,
I've seen a lot of people asking how to limit number of articles per user, but really have not seen a single solution. I am looking into work around, but not sure how to do it. Basically users on my site can add articles through a link in K2 login module [mod_k2_login] and that is the only way. Can anyone help me to change this bit of code:
<ul class="k2UserBlockActions">
<?php if(is_object($user->profile) && isset($user->profile->addLink)): ?>
<li>
<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $user->profile->addLink; ?>"><?php echo JText::_('K2_ADD_NEW_ITEM'); ?></a>
</li>
<?php endif; ?>
<li>
<a href="<?php echo JRoute::_(K2HelperRoute::getUserRoute($user->id)); ?>"><?php echo JText::_('K2_MY_PAGE'); ?></a>
</li>
Basically my aim is for 'K2_ADD_NEW_ITEM' to be visible if user has not created any items (item count 0) and become invisible if user has created one (item count 1). At the same time 'K2_MY_PAGE' should be displayed other way around (be invisible if user has created no item and become visible when has created one).
Any advice is highly appreciated!
Thank you