Esempio n. 1
0
	public function onAfterReply($message) {
		// Check for permisions of the current category - activity only if public or registered
		if ( $this->_checkPermissions($message) ) {
			$datareference = '<a rel="nofollow" href="' . KunenaRoute::_($message->getPermaUrl()) . '">' . $message->subject . '</a>';
			$referreid = AlphaUserPointsHelper::getReferreid( $message->userid );
			if (JString::strlen($message->message) > $this->params->get('activity_points_limit', 0)) {
				if ( $this->_checkRuleEnabled( 'plgaup_kunena_topic_reply' ) ) {
					$keyreference = $this->_buildKeyreference( 'plgaup_kunena_topic_reply', $message->id ) ;
					AlphaUserPointsHelper::newpoints ( 'plgaup_kunena_topic_reply', $referreid, $keyreference, $datareference );
				}
			}
		}
	}
Esempio n. 2
0
 public function onAfterReply($message)
 {
     // Check for permisions of the current category - activity only if public or registered
     if ($this->_checkPermissions($message)) {
         require_once KPATH_SITE . '/lib/kunena.link.class.php';
         $datareference = '<a href="' . CKunenaLink::GetMessageURL($message->get('id'), $message->get('catid')) . '">' . $message->get('subject') . '</a>';
         $referreid = AlphaUserPointsHelper::getReferreid($message->get('userid'));
         if ($this->_config->alphauserpointsnumchars > 0) {
             // use if limit chars for a response
             if (JString::strlen($message->get('message')) > $this->_config->alphauserpointsnumchars) {
                 if ($this->_getAUPversion() < '1.5.12') {
                     if ($this->_checkRuleEnabled('plgaup_reply_kunena')) {
                         AlphaUserPointsHelper::newpoints('plgaup_reply_kunena', $referreid, $message->get('id'), $datareference);
                     } else {
                         return;
                     }
                 } elseif ($this->_getAUPversion() >= '1.5.12') {
                     if ($this->_checkRuleEnabled('plgaup_kunena_topic_reply')) {
                         AlphaUserPointsHelper::newpoints('plgaup_kunena_topic_reply', $referreid, $message->get('id'), $datareference);
                     } else {
                         return;
                     }
                 }
             }
         } else {
             if ($this->_getAUPversion() < '1.5.12') {
                 if ($this->_checkRuleEnabled('plgaup_reply_kunena')) {
                     AlphaUserPointsHelper::newpoints('plgaup_reply_kunena', $referreid, $message->get('id'), $datareference);
                 } else {
                     return;
                 }
             } elseif ($this->_getAUPversion() >= '1.5.12') {
                 if ($this->_checkRuleEnabled('plgaup_kunena_topic_reply')) {
                     AlphaUserPointsHelper::newpoints('plgaup_kunena_topic_reply', $referreid, $message->get('id'), $datareference);
                 } else {
                     return;
                 }
             }
         }
     }
 }
 public function onUserLogin($user, $options = array())
 {
     $app = JFactory::getApplication();
     $db = JFactory::getDBO();
     jimport('joomla.user.helper');
     $instance = new JUser();
     if ($id = intval(JUserHelper::getUserId($user['username']))) {
         $instance->load($id);
     }
     if ($instance->get('block') == 0) {
         require_once JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
         // start the user session for AlphaUserpoints
         AlphaUserPointsHelper::getReferreid(intval($instance->get('id')));
         if ($app->isSite()) {
             // load language component
             $lang = JFactory::getLanguage();
             $lang->load('com_alphauserpoints', JPATH_SITE);
             // check raffle subscription to showing a reminder message
             // check first if rule for raffle is enabled
             $result = AlphaUserPointsHelper::checkRuleEnabled('sysplgaup_raffle', 1);
             if ($result) {
                 $resultCurrentRaffle = $this->checkIfCurrentRaffleSubscription(intval($instance->get('id')));
                 if ($resultCurrentRaffle == 'stillRegistered') {
                     $messageAvailable = JText::_('AUP_YOU_ARE_STILL_NOT_REGISTERED_FOR_RAFFLE');
                     if ($messageAvailable != '') {
                         $messageRaffle = sprintf(JText::_('AUP_YOU_ARE_STILL_NOT_REGISTERED_FOR_RAFFLE'), $user['username']);
                         $app->enqueueMessage($messageRaffle);
                     }
                 }
             }
         }
         //return true;
     }
 }