当前位置: 首页>>代码示例>>PHP>>正文


PHP AlphaUserPointsHelper::getAnyUserReferreID方法代码示例

本文整理汇总了PHP中AlphaUserPointsHelper::getAnyUserReferreID方法的典型用法代码示例。如果您正苦于以下问题:PHP AlphaUserPointsHelper::getAnyUserReferreID方法的具体用法?PHP AlphaUserPointsHelper::getAnyUserReferreID怎么用?PHP AlphaUserPointsHelper::getAnyUserReferreID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AlphaUserPointsHelper的用法示例。


在下文中一共展示了AlphaUserPointsHelper::getAnyUserReferreID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store


//.........这里部分代码省略.........
         $this->intro = $inputFilter->clean($this->intro);
         $this->content = $inputFilter->clean($this->content);
     }
     // @rule: Process badword filters for content here.
     $blockedWord = EasyBlogHelper::getHelper('String')->hasBlockedWords($this->intro . $this->content);
     if ($blockedWord !== false) {
         $this->setError(JText::sprintf('COM_EASYBLOG_BLOG_POST_CONTAIN_BLOCKED_WORDS', $blockedWord));
         return false;
     }
     // @rule: Test for the empty-ness
     if (empty($this->intro) && empty($this->content)) {
         $this->setError(JText::_('COM_EASYBLOG_DASHBOARD_SAVE_CONTENT_ERROR'));
     }
     // alway set this to false no matter what! TODO: remove this column.
     $this->ispending = '0';
     $state = parent::store();
     $source = JRequest::getVar('blog_contribute_source', 'easyblog');
     // @trigger: onBeforeSave
     $this->triggerAfterSave();
     // if this is blog edit, then we should see the column isnew to determine
     // whether the post is really new or not.
     if (!$isNew) {
         $isNew = $this->isnew;
     }
     // @task: If auto featured is enabled, we need to feature the blog post automatically since the blogger is featured.
     if ($config->get('main_autofeatured', 0) && EasyBlogHelper::isFeatured('blogger', $this->created_by) && !EasyBlogHelper::isFeatured('post', $this->id)) {
         EasyBlogHelper::makeFeatured('post', $this->id);
     }
     // @task: This is when the blog is either created or updated.
     if ($source == 'easyblog' && $state && $this->published == POST_ID_PUBLISHED && $log) {
         // @rule: Add new stream item in jomsocial
         EasyBlogHelper::addJomSocialActivityBlog($this, $isNew);
         // @rule: Log new stream item into EasyBlog
         $activity = new stdClass();
         $activity->actor_id = $this->created_by;
         $activity->target_id = '0';
         $activity->context_type = 'post';
         $activity->context_id = $this->id;
         $activity->verb = $isNew ? 'add' : 'update';
         $activity->uuid = $this->title;
         EasyBlogHelper::activityLog($activity);
     }
     if ($source == 'easyblog' && $state && $this->published == POST_ID_PUBLISHED && $isNew && $log) {
         // @rule: Send email notifications out to subscribers.
         $author = EasyBlogHelper::getTable('Profile');
         $author->load($this->created_by);
         // @rule: Ping pingomatic
         if ($config->get('main_pingomatic')) {
             if (!EasyBlogHelper::getHelper('Pingomatic')->ping($this->title, EasyBlogHelper::getExternalLink('index.php?option=com_easyblog&view=entry&id=' . $this->id, true))) {
                 EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_DASHBOARD_SAVE_PINGOMATIC_ERROR'), 'error');
             }
         }
         // Assign EasySocial points
         $easysocial = EasyBlogHelper::getHelper('EasySocial');
         $easysocial->assignPoints('blog.create', $this->created_by);
         // @rule: Add userpoints for jomsocial
         if ($config->get('main_jomsocial_userpoint')) {
             $path = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'userpoints.php';
             if (JFile::exists($path)) {
                 require_once $path;
                 CUserPoints::assignPoint('com_easyblog.blog.add', $this->created_by);
             }
         }
         $link = $this->getExternalBlogLink('index.php?option=com_easyblog&view=entry&id=' . $this->id);
         // @rule: Add notifications for jomsocial 2.6
         if ($config->get('integrations_jomsocial_notification_blog')) {
             // Get list of users who subscribed to this blog.
             $target = $this->getRegisteredSubscribers('new', array($this->created_by));
             EasyBlogHelper::getHelper('JomSocial')->addNotification(JText::sprintf('COM_EASYBLOG_JOMSOCIAL_NOTIFICATIONS_NEW_BLOG', $author->getName(), $link, $this->title), 'easyblog_new_blog', $target, $this->created_by, $link);
         }
         // @rule: Mighty Touch karma points
         EasyBlogHelper::getHelper('MightyTouch')->setKarma($this->created_by, 'new_blog');
         // @rule: Integrations with EasyDiscuss
         EasyBlogHelper::getHelper('EasyDiscuss')->log('easyblog.new.blog', $this->created_by, JText::sprintf('COM_EASYBLOG_EASYDISCUSS_HISTORY_NEW_BLOG', $this->title));
         EasyBlogHelper::getHelper('EasyDiscuss')->addPoint('easyblog.new.blog', $this->created_by);
         EasyBlogHelper::getHelper('EasyDiscuss')->addBadge('easyblog.new.blog', $this->created_by);
         // Assign badge for users that report blog post.
         // Only give points if the viewer is viewing another person's blog post.
         EasyBlogHelper::getHelper('EasySocial')->assignBadge('blog.create', JText::_('COM_EASYBLOG_EASYSOCIAL_BADGE_CREATE_BLOG_POST'));
         if ($config->get('integrations_easydiscuss_notification_blog')) {
             // Get list of users who subscribed to this blog.
             $target = $this->getRegisteredSubscribers('new', array($this->created_by));
             EasyBlogHelper::getHelper('EasyDiscuss')->addNotification($this, JText::sprintf('COM_EASYBLOG_EASYDISCUSS_NOTIFICATIONS_NEW_BLOG', $author->getName(), $this->title), EBLOG_NOTIFICATIONS_TYPE_BLOG, $target, $this->created_by, $link);
         }
         $my = JFactory::getUser();
         // @rule: Add points for AlphaUserPoints
         if ($my->id == $this->created_by && EasyBlogHelper::isAUPEnabled()) {
             // get blog post URL
             $url = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $this->id);
             $aupid = AlphaUserPointsHelper::getAnyUserReferreID($this->created_by);
             AlphaUserPointsHelper::newpoints('plgaup_easyblog_add_blog', $aupid, 'easyblog_add_blog_' . $this->id, JText::sprintf('COM_EASYBLOG_AUP_NEW_BLOG_CREATED', $url, $this->title));
         }
         // @rule: Process trackbacks
         $this->processTrackbacks();
         // Update the isnew column so that if user edits this entry again, it doesn't send any notifications the second time.
         $this->isnew = 0;
         $this->store(false);
     }
     return $state;
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:101,代码来源:blogs.php

示例2: reader2author

 public function reader2author($authorid = 0, $author = '', $articleid = 0, $title = '', $url = '')
 {
     $app = JFactory::getApplication();
     require_once JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
     if (!$authorid || !$articleid) {
         return;
     }
     // get referrerid of author
     $referrerUserAuthor = AlphaUserPointsHelper::getAnyUserReferreID($authorid);
     if (!AlphaUserPointsHelper::checkExcludeUsers($referrerUserAuthor)) {
         return;
     }
     $ip = getenv('REMOTE_ADDR');
     $db = JFactory::getDBO();
     $keyreference = $articleid . "|" . $ip;
     $keyreference = AlphaUserPointsHelper::buildKeyreference('sysplgaup_reader2author', $keyreference);
     // check if not already view by active user
     $query = "SELECT `id` FROM #__alpha_userpoints_details WHERE `keyreference`='" . $keyreference . "'";
     $db->setQuery($query);
     $alreadyView = $db->loadResult();
     if (!$alreadyView) {
         $user = JFactory::getUser();
         $jnow = JFactory::getDate();
         $now = $jnow->toSql();
         $authorizedLevels = JAccess::getAuthorisedViewLevels($user->id);
         $query = "SELECT * FROM #__alpha_userpoints_rules WHERE `plugin_function`='sysplgaup_reader2author' AND `published`='1' AND `access` IN (" . implode(",", $authorizedLevels) . ") AND (`rule_expire`>'{$now}' OR `rule_expire`='0000-00-00 00:00:00')";
         $db->setQuery($query);
         $result = $db->loadObjectList();
         if ($result && $referrerUserAuthor) {
             $datareference = '<a href="' . $url . '">' . $title . '</a> (' . $author . ')';
             AlphaUserPointsHelper::insertUserPoints($referrerUserAuthor, $result[0], 0, $keyreference, $datareference);
         }
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:34,代码来源:sysplgaup_reader2author.php

示例3: remove

 function remove()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     // @task: Check for acl rules.
     $this->checkAccess('comment');
     $comments = JRequest::getVar('cid', '', 'POST');
     $message = '';
     $type = 'message';
     if (empty($comments)) {
         $message = JText::_('Invalid comment id');
         $type = 'error';
     } else {
         $table = EasyBlogHelper::getTable('Comment', 'Table');
         foreach ($comments as $comment) {
             $table->load($comment);
             // AlphaUserPoints
             // since 1.2
             if (!empty($table->created_by) && EasyBlogHelper::isAUPEnabled()) {
                 $aupid = AlphaUserPointsHelper::getAnyUserReferreID($table->created_by);
                 AlphaUserPointsHelper::newpoints('plgaup_easyblog_delete_comment', $aupid, '', JText::_('COM_EASYBLOG_AUP_COMMENT_DELETED'));
             }
             if (!$table->delete()) {
                 $message = JText::_('COM_EASYBLOG_COMMENTS_COMMENT_REMOVE_ERROR');
                 $type = 'error';
                 $this->setRedirect('index.php?option=com_easyblog&view=comments', $message, $type);
                 return;
             }
             $message = JText::_('COM_EASYBLOG_COMMENTS_COMMENT_REMOVED');
         }
     }
     $this->setRedirect('index.php?option=com_easyblog&view=comments', $message, $type);
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:33,代码来源:comment.php

示例4: refundDeal

 function refundDeal($user_id, $point)
 {
     $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
     require_once $api_AUP;
     $aupid = AlphaUserPointsHelper::getAnyUserReferreID($user_id);
     if ($aupid) {
         AlphaUserPointsHelper::newpoints('plgaup_com_enmasse_refund_by_point', $aupid, '', '', $point);
     }
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:9,代码来源:alphauserpoints.class.php

示例5: assignPoints

 public function assignPoints($cmd, $userId, $message)
 {
     if (!$this->enabled()) {
         return false;
     }
     // Get the user id
     $userId = AlphaUserPointsHelper::getAnyUserReferreID($userId);
     $state = AlphaUserPointsHelper::newpoints($cmd, $userId, '', $message);
     return $state;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:10,代码来源:aup.php

示例6: awardPoints

 function awardPoints($userid, $function, $referrence, $info)
 {
     $app =& JFactory::getApplication();
     $cwConfig =& CrosswordsHelper::get_configuration();
     if (strcasecmp($cwConfig[POINTS_SYSTEM], COMPONENT_AUP) == 0) {
         $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
         if (file_exists($api_AUP)) {
             require_once $api_AUP;
             $aupid = AlphaUserPointsHelper::getAnyUserReferreID($userid);
             if ($aupid) {
                 switch ($function) {
                     case 1:
                         //New Question
                         AlphaUserPointsHelper::newpoints(AUP_NEW_QUESTION, $aupid, $referrence, $info);
                         break;
                     case 2:
                         // Solved crossword
                         AlphaUserPointsHelper::newpoints(AUP_SOLVE_CROSSWORD, $aupid, $referrence, $info);
                         break;
                 }
             }
         }
     } else {
         if (strcasecmp($cwConfig[POINTS_SYSTEM], COMPONENT_JOMSOCIAL) == 0) {
             include_once JPATH_SITE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'userpoints.php';
             switch ($function) {
                 case 1:
                     //New Question
                     CuserPoints::assignPoint(JSP_NEW_QUESTION, $userid);
                     break;
                 case 2:
                     // New Answer
                     CuserPoints::assignPoint(JSP_SOLVED_CROSSWORD, $userid);
                     break;
             }
         } else {
             if (strcasecmp($cwConfig[POINTS_SYSTEM], COMPONENT_TOUCH) == 0) {
                 $API = JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'api.php';
                 if (file_exists($API)) {
                     require_once $API;
                     switch ($function) {
                         case 1:
                             //New Question
                             JSCommunityApi::increaseKarma($userid, $cwConfig[TOUCH_POINTS_NEW_QUESTION]);
                             break;
                         case 2:
                             // New Answer
                             JSCommunityApi::increaseKarma($userid, $cwConfig[TOUCH_POINTS_SOLVED_CROSSWORD]);
                             break;
                     }
                 }
             }
         }
     }
 }
开发者ID:phat20092009,项目名称:community-crosswords,代码行数:55,代码来源:helper.php

示例7: getProfileURL

	public function getProfileURL($user, $task = '', $xhtml = true) {
		if ($user == 0)
			return false;
		$user = KunenaFactory::getUser ( $user );
		$my = JFactory::getUser ();
		if ($user === false)
			return false;
		$userid = $my->id != $user->userid ? '&userid=' . AlphaUserPointsHelper::getAnyUserReferreID ( $user->userid ) : '';
		$AUP_itemid = AlphaUserPointsHelper::getItemidAupProfil ();
		return JRoute::_ ( 'index.php?option=com_alphauserpoints&view=account' . $userid . '&Itemid=' . $AUP_itemid, $xhtml );
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:11,代码来源:profile.php

示例8: onAfterVote

 function onAfterVote($poll, $option_id)
 {
     $user =& JFactory::getUser();
     $aup = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
     if ($this->params->get('points', '0') == '1' && file_exists($aup)) {
         require_once $aup;
         $aup_id = AlphaUserPointsHelper::getAnyUserReferreID($user->id);
         if ($aup_id) {
             AlphaUserPointsHelper::newpoints('sysplgaup_votepoll', $aup_id, '', JText::_('COM_MIJOPOLLS_CAST_VOTE_AUP') . ' ' . $poll->id, $this->params->get('points_value', '0'), true);
         }
     }
 }
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:12,代码来源:alphauserpoints.php

示例9: assign

 public function assign($rule, $userId, $title)
 {
     if (!$this->exists || !isset($this->rules[$rule])) {
         return false;
     }
     JFactory::getLanguage()->load('com_easydiscuss', JPATH_ROOT);
     // TODO: Fixed strict standard issue.
     $aup = new AlphaUserPointsHelper();
     $id = $aup->getAnyUserReferreID($userId);
     //$id	= AlphaUserPointsHelper::getAnyUserReferreID( $userId );
     $rule = $this->rules[$rule];
     $aup->newpoints('plgaup_easydiscuss_' . strtolower($rule), $id, '', JText::sprintf('COM_EASYDISCUSS_AUP_' . strtoupper($rule), $title));
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:13,代码来源:aup.php

示例10: getProfileURL

	public function getProfileURL($user, $task = '', $xhtml = true) {
		if ($user == 0)
			return false;
		$user = KunenaFactory::getUser ( $user );
		$my = JFactory::getUser ();
		if ($user === false)
			return false;
		$userid = $my->id != $user->userid ? '&userid=' . AlphaUserPointsHelper::getAnyUserReferreID ( $user->userid ) : '';
		if (method_exists ( 'AlphaUserPointsHelper', 'getItemidAupProfil' )) {
			$AUP_itemid = AlphaUserPointsHelper::getItemidAupProfil ();
		} else {
			$db = JFactory::getDBO ();
			$query = "SELECT id FROM #__menu WHERE link='index.php?option=com_alphauserpoints&view=account' AND type='component' AND published='1'";
			$db->setQuery ( $query );
			$AUP_itemid = intval ( $db->loadResult () );
		}
		return JRoute::_ ( 'index.php?option=com_alphauserpoints&view=account' . $userid . '&Itemid=' . $AUP_itemid, $xhtml );
	}
开发者ID:rich20,项目名称:Kunena,代码行数:18,代码来源:profile.php

示例11: vote

 public function vote($value, $uid, $type, $elementId)
 {
     $ajax = new Ejax();
     $my = JFactory::getUser();
     $config = EasyBlogHelper::getConfig();
     $blog = EasyBlogHelper::getTable('Blog', 'Table');
     $blog->load($uid);
     if ($config->get('main_password_protect', true) && !empty($blog->blogpassword)) {
         if (!EasyBlogHelper::verifyBlogPassword($blog->blogpassword, $blog->id)) {
             echo 'Invalid Access.';
             exit;
         }
     }
     $rating = EasyBlogHelper::getTable('Ratings', 'Table');
     // Do not allow guest to vote, or if the voter already voted.
     if ($rating->fill($my->id, $uid, $type, JFactory::getSession()->getId()) || $my->id < 1 && !$config->get('main_ratings_guests')) {
         // We wouldn't allow user to vote more than once so don't do anything here
         $ajax->send();
     }
     $rating->set('created_by', $my->id);
     $rating->set('type', $type);
     $rating->set('uid', $uid);
     $rating->set('ip', @$_SERVER['REMOTE_ADDR']);
     $rating->set('value', (int) $value);
     $rating->set('sessionid', JFactory::getSession()->getId());
     $rating->set('created', EasyBlogHelper::getDate()->toMySQL());
     $rating->set('published', 1);
     $rating->store();
     $model = EasyBlogHelper::getModel('Ratings');
     $ratingValue = $model->getRatingValues($uid, $type);
     $total = $ratingValue->total;
     $rating = $ratingValue->ratings;
     // Assign badge for users that report blog post.
     // Only give points if the viewer is viewing another person's blog post.
     EasyBlogHelper::getHelper('EasySocial')->assignBadge('blog.rate', JText::_('COM_EASYBLOG_EASYSOCIAL_BADGE_RATED_BLOG'));
     $ajax->script('eblog.loader.doneLoading("' . $elementId . '-command .ratings-text")');
     $ajax->script('eblog.ratings.update("' . $elementId . '", "' . $type . '" , "' . $rating . '" , "' . JText::_('COM_EASYBLOG_RATINGS_RATED_THANK_YOU') . '");');
     $ajax->assign($elementId . ' .ratings-value', '<i></i>' . $total . '<b>&radic;</b>');
     if (EasyBlogHelper::isAUPEnabled()) {
         $id = AlphaUserPointsHelper::getAnyUserReferreID($my->id);
         AlphaUserPointsHelper::newpoints('plgaup_easyblog_rate_blog', $id, '', JText::sprintf('COM_EASYBLOG_AUP_BLOG_RATED'), '');
     }
     $ajax->send();
 }
开发者ID:Tommar,项目名称:vino2,代码行数:44,代码来源:view.ejax.php

示例12: onAfterThankyou

	public function onAfterThankyou($actor, $target, $message) {
		$infoTargetUser = JText::_('COM_KUNENA_THANKYOU_GOT_FROM').': ' . KunenaFactory::getUser($actor)->username;
		$infoRootUser = JText::_('COM_KUNENA_THANKYOU_SAID_TO').': ' . KunenaFactory::getUser($target)->username;
		if ($this->_checkPermissions($message)) {
			$aupactor = AlphaUserPointsHelper::getAnyUserReferreID($actor);
			$auptarget = AlphaUserPointsHelper::getAnyUserReferreID($target);

			$ruleName = 'plgaup_kunena_message_thankyou';

			$usertargetpoints = intval($this->_getPointsOnThankyou($ruleName));

			if ( $usertargetpoints && $this->_checkRuleEnabled($ruleName) ) {
				// for target user
				if ($auptarget) AlphaUserPointsHelper::newpoints($ruleName , $auptarget, '', $infoTargetUser, $usertargetpoints);
				// for who has gived the thank you
				if ($aupactor) AlphaUserPointsHelper::newpoints($ruleName , $aupactor, '', $infoRootUser );
			}
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:19,代码来源:activity.php

示例13: onAfterProcess

 /**
  * Run right at the end of the form processing
  * form needs to be set to record in database for this to hook to be called
  *
  * @throws Exception
  *
  * @return	bool
  */
 public function onAfterProcess()
 {
     $params = $this->getParams();
     $api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
     if (JFile::exists($api_AUP)) {
         $w = new FabrikWorker();
         $this->data = $this->getProcessData();
         require_once $api_AUP;
         $aup = new AlphaUserPointsHelper();
         // Define which user will receive the points.
         $userId = $params->get('user_id', '');
         $userId = (int) $w->parseMessageForPlaceholder($userId, $this->data, false);
         $aupId = $aup->getAnyUserReferreID($userId);
         // Replace these if you want to show a specific reference for the attributed points - doesn't seem to effect anything
         $keyReference = '';
         // Shown in the user details page - description of what the point is for
         $dataReference = $params->get('data_reference', '');
         $dataReference = $w->parseMessageForPlaceholder($dataReference, $this->data, false);
         // Override the plugin default points
         $randomPoints = $params->get('random_points', 0);
         if ($params->get('random_points_eval', '0') == '1') {
             if (!empty($randomPoints)) {
                 $randomPoints = $w->parseMessageForPlaceholder($randomPoints, $this->data, false);
                 $randomPoints = @eval($randomPoints);
                 FabrikWorker::logEval($randomPoints, 'Caught exception on eval in aup plugin : %s');
             }
             $randomPoints = (double) $randomPoints;
         } else {
             $randomPoints = (double) $w->parseMessageForPlaceholder($randomPoints, $this->data, false);
         }
         // If set to be greater than $randompoints then this is the # of points assigned (not sure when this would be used - commenting out for now)
         $referralUserPoints = 0;
         $aupPlugin = $params->get('aup_plugin', 'plgaup_fabrik');
         $aupPlugin = $w->parseMessageForPlaceholder($aupPlugin, $this->data, false);
         if (!$aup->checkRuleEnabled($aupPlugin, 0, $aupId)) {
             throw new Exception('Alpha User Points plugin not published');
         }
         $aup->userpoints($aupPlugin, $aupId, $referralUserPoints, $keyReference, $dataReference, $randomPoints);
     }
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:48,代码来源:alphauserpoints.php

示例14: addAUP

 public static function addAUP($plugin_function = '', $referrerid = '', $keyreference = '', $datareference = '')
 {
     $my = JFactory::getUser();
     if (!empty($referrerid)) {
         $my = JFactory::getUser($referrerid);
     }
     if ($my->id != 0) {
         $aup = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_alphauserpoints' . DIRECTORY_SEPARATOR . 'helper.php';
         if (JFile::exists($aup)) {
             require_once $aup;
             AlphaUserPointsHelper::newpoints($plugin_function, AlphaUserPointsHelper::getAnyUserReferreID($referrerid), $keyreference, $datareference);
         }
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:14,代码来源:helper.php

示例15: setAUPPointsDownloaderToUploaderPrice

 /**
  * Assign points to the file uploader when a user download his file and use the price field  
  * 
  * @param mixed $files
  */
 public static function setAUPPointsDownloaderToUploaderPrice($files)
 {
     $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
     if (file_exists($api_AUP)) {
         require_once $api_AUP;
         foreach ($files as $file) {
             if ($file->submitted_by) {
                 $referreid = AlphaUserPointsHelper::getAnyUserReferreID((int) $file->submitted_by);
                 if ($referreid) {
                     $key_reference = AlphaUserPointsHelper::buildKeyreference('plgaup_jdownloads_downloader_to_uploader_use_price', $file->file_id, (int) $file->submitted_by);
                     $rule_id = AlphaUserPointsHelper::getRuleID('plgaup_jdownloads_downloader_to_uploader_use_price');
                     $check_aup_reference = AlphaUserPointsHelper::checkReference($referreid, $key_reference, $rule_id);
                     // check the method when a prior download process is found
                     if ($check_aup_reference > 0) {
                         $method = (int) AlphaUserPointsHelper::getMethod('plgaup_jdownloads_downloader_to_uploader_use_price');
                         switch ($method) {
                             case 1:
                                 // ONCE PER USER
                                 // has already payed
                                 return;
                                 break;
                             case '2':
                                 // ONCE PER DAY AND PER USER'
                                 return;
                                 break;
                             case '3':
                                 // ONCE A DAY FOR A SINGLE USER ON ALL USERS
                                 return;
                                 break;
                             case '5':
                                 // ONCE PER USER PER WEEK
                                 return;
                                 break;
                             case '6':
                                 // ONCE PER USER PER MONTH
                                 return;
                                 break;
                             case '7':
                                 // ONCE PER USER PER YEAR
                                 return;
                                 break;
                                 /*
                                 case '4':       // WHENEVER
                                 case '0':
                                 default:                            
                                     // points must be payed always
                                 */
                         }
                     }
                     $text = JText::_('COM_JDOWNLOADS_BACKEND_SET_AUP_DOWNLOAD_TEXT');
                     $text = sprintf($text, $file->file_title);
                     $price = floatval($file->price);
                     AlphaUserPointsHelper::newpoints('plgaup_jdownloads_downloader_to_uploader_use_price', $referreid, $key_reference, $text, '+' . $price, $text);
                 }
             }
         }
     }
 }
开发者ID:ashanrupasinghe,项目名称:dnp,代码行数:63,代码来源:jdownloadshelper.php


注:本文中的AlphaUserPointsHelper::getAnyUserReferreID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。