Keyword

onK2BeforeDownload and onK2AfterDownload

  • Markus
  • Markus's Avatar Topic Author
  • Visitor
14 years 8 months ago #81260 by Markus
Hi,
i have a little problem with the Download trigger:

i would like to make an Plugin that does following:

The Download is only for Members with xxx Points in AUP.

this is a part of my plugin code:

function onK2BeforeDownload(&$attachment, &$params) {
global $mainframe;
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
$user = & JFactory::getUser();
$userID = $user->id ;
$profil=AlphaUserPointsHelper:: getUserInfo ( '', $userID ) ;
//print_r($profil);

$dlpoints = $profil->points;
if ($dlpoints <= "400") {
$mainframe->enqueueMessage(JText::_("You don't have not enough points to download."), 'notice');
                                }


}
}


but i have no idea to break/stop the download function when the user has not enough points...

I hope someone can help me...

best regards
Markus

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum