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


PHP AlphaUserPointsHelper::newpoints方法代码示例

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


在下文中一共展示了AlphaUserPointsHelper::newpoints方法的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: save

 function save()
 {
     $model = $this->getModel('muzeededi');
     $db = $model->connectMuzeeli();
     $dedicace = JRequest::getVar('dedicace', '', '', 'string');
     $params =& JComponentHelper::getParams('com_muzeededi');
     $moderer_site = $params->get('moderer_site');
     $moderer = $moderer_site == "yes" ? "0" : "1";
     $q_dedicace = $db->Quote($dedicace);
     $query = "INSERT INTO #__muzeededi (id,dedicace,moderer) VALUES ('',{$q_dedicace},'{$moderer}')";
     $test = $db->SetQuery($query);
     $test2 = $db->query();
     $msg = "";
     if ($test2 === true) {
         //point alphauserpoints
         $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
         if (file_exists($api_AUP)) {
             require_once $api_AUP;
             AlphaUserPointsHelper::newpoints('plgaup_muzeededi', '', '', 'Dédicace');
         }
         //fin alphauserpoints
         if ($moderer == "0") {
             $msg = JTEXT::_("COM_MUZEEDEDI_DEDICACE_ENREGISTREE");
         } else {
             $texte = $model->getDedicaces($db);
             $creer_txt = $model->creerFichier($texte);
             $msg = JTEXT::_("COM_MUZEEDEDI_DEDICACE_PUBLIE");
         }
         $mail = $this->alerteMail($dedicace, $moderer);
     } else {
         $msg = JTEXT::_("COM_MUZEEDEDI_DEDICACE_ERREUR");
     }
     $link = 'index.php?option=com_muzeededi';
     $this->setRedirect($link, $msg);
 }
开发者ID:halbo5,项目名称:com_muzeededi,代码行数:35,代码来源:controller.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: assign

 public function assign($cmd, $msg, $cmdSingle, $text)
 {
     if (!$this->enabled()) {
         return false;
     }
     $state = AlphaUserPointsHelper::newpoints($cmd, $msg, $cmdSingle, $text);
     return $state;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:8,代码来源:aup.php

示例5: 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

示例6: checkcoupon

 public static function checkcoupon($params, $coupon)
 {
     $app = JFactory::getApplication();
     // check if user is logged in
     $user = JFactory::getUser();
     if (!$user->id) {
         echo "<script> alert('" . JText::_('MODAUP_CP_YOU_MUST_BE_LOGGED') . "'); </script>";
         return;
     }
     // insert API AlphaUserPoint
     $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
     if (file_exists($api_AUP)) {
         require_once $api_AUP;
         $db = JFactory::getDBO();
         $nullDate = $db->getNullDate();
         $date = JFactory::getDate();
         $now = $date->toSql();
         $query = "SELECT * FROM #__alpha_userpoints_coupons WHERE `couponcode`='{$coupon}' AND (`expires`>='{$now}' OR `expires`='0000-00-00 00:00:00')";
         $db->setQuery($query);
         $result = $db->loadObjectList();
         if ($result) {
             $resultCouponExist = 0;
             // active user
             $referrerid = @$_SESSION['referrerid'];
             // check if public or private coupon
             if (!$result[0]->public) {
                 // private -> usable once per one user
                 $query = "SELECT count(*) FROM #__alpha_userpoints_details WHERE `keyreference`='{$coupon}'";
                 $db->setQuery($query);
                 $resultCouponExist = $db->loadResult();
                 if (!$resultCouponExist) {
                     // insert points
                     AlphaUserPointsHelper::newpoints('sysplgaup_couponpointscodes', $referrerid, $result[0]->couponcode, $result[0]->description, $result[0]->points);
                 } else {
                     $app->enqueueMessage(JText::_('MODAUP_CP_THIS_COUPON_WAS_ALREADY_USED'));
                 }
             } elseif ($result[0]->public) {
                 // public -> usable once per all users
                 $keyreference = $coupon . "##" . $user->id;
                 $query = "SELECT count(*) FROM #__alpha_userpoints_details WHERE `keyreference`='{$keyreference}'";
                 $db->setQuery($query);
                 $resultCouponExist = $db->loadResult();
                 if (!$resultCouponExist) {
                     // insert points
                     AlphaUserPointsHelper::newpoints('sysplgaup_couponpointscodes', $referrerid, $keyreference, $result[0]->description, $result[0]->points);
                 } else {
                     $app->enqueueMessage(JText::_('MODAUP_CP_THIS_COUPON_WAS_ALREADY_USED'));
                 }
             }
         } else {
             $app->enqueueMessage(JText::_('MODAUP_CP_PLEASE_CHECK_YOUR_COUPON'));
             return;
         }
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:55,代码来源:helper.php

示例7: 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

示例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: awardPoints

 public function awardPoints($userId, $name, $args)
 {
     require_once $this->_componentFile;
     $key = $args->get('key', '');
     $name = str_replace(".", "_", $name);
     $name = 'plgaup_jfbconnect_' . $name;
     $keyreference = AlphaUserPointsHelper::buildKeyreference($name, $key);
     // get the current user's Referrerid always, for now.
     $profile = AlphaUserPointsHelper::getUserInfo('', $userId);
     $referrerId = $profile->referreid;
     $return = AlphaUserPointsHelper::newpoints($name, $referrerId, $keyreference);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:12,代码来源:alphauserpoints.php

示例10: 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

示例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: save

 function save()
 {
     $model = $this->getModel('mzpromoradio');
     $db = $model->connectMuzeeli();
     $nom = JRequest::getVar('nom', '', '', 'string');
     $description = JRequest::getVar('description', '', '', 'string');
     $uid = JRequest::getVar('uid', '', '', 'string');
     $nom_site = JRequest::getVar('nom_site', '', '', 'string');
     $lien_site = JRequest::getVar('lien_site', '', '', 'string');
     $id_user = JRequest::getVar('id_abonnes', '', '', 'int');
     $flux = JREQUEST::getVar('flux', '', '', 'flux');
     //$params = &JComponentHelper::getParams( 'com_muzeededi' );
     $q_nom = $db->Quote(htmlspecialchars($nom));
     $q_description = $db->Quote(htmlspecialchars($description));
     $q_uid = $db->Quote(htmlspecialchars($uid));
     $q_nom_site = $db->Quote(htmlspecialchars($nom_site));
     $q_lien_site = $db->Quote(htmlspecialchars($lien_site));
     $q_flux = $db->Quote(htmlspecialchars($flux));
     $query = "INSERT INTO #__mzpromoradio (id,nom,description,uid,nom_site,lien_site,id_user,flux) VALUES ('',{$q_nom},{$q_description},{$q_uid},{$q_nom_site},{$q_lien_site},'{$id_user}',{$q_flux})";
     $test = $db->SetQuery($query);
     $test2 = $db->query();
     $msg = "";
     if ($test2 === true) {
         //point alphauserpoints
         $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
         if (file_exists($api_AUP)) {
             require_once $api_AUP;
             AlphaUserPointsHelper::newpoints('plgaup_mzpromoradio', '', $uid, 'Promo Radio');
         }
         //fin alphauserpoints
         $mail = $this->alerteMail($nom);
         $msg = JTEXT::_("COM_MZPROMORADIO_PROMO_ENREGISTREE");
     } else {
         $msg = JTEXT::_("COM_MZPROMORADIO_PROMO_ERREUR");
     }
     $link = 'index.php?option=com_mzpromoradio';
     $this->setRedirect($link, $msg);
 }
开发者ID:halbo5,项目名称:com_mzpromoradio,代码行数:38,代码来源:controller.php

示例14: award_points

 /**
  * Award points to the user using selected points system. The user id and required parameters should be passed based on points system selected.
  *
  * Parameters array should be an associative array which can include
  * <ul>
  * 	<li>function: the function name used to award points.</li>
  * 	<li>points: points awarded to the user. For jomsocial this has no effect as the points are taken from xml rule.</li>
  * 	<li>reference: the reference string for AUP rule</li>
  * 	<li>info: Brief information about this point.</li>
  * </ul>
  *
  * @param string $system
  * @param int $userid
  * @param array $params
  */
 public static function award_points($system, $userid, $params = array())
 {
     switch ($system) {
         case 'cjblog':
             $api = JPATH_ROOT . DS . 'components' . DS . 'com_cjblog' . DS . 'api.php';
             if (file_exists($api)) {
                 include_once $api;
                 $points = !empty($params['points']) ? $params['points'] : 0;
                 $reference = !empty($params['reference']) ? $params['reference'] : null;
                 $description = !empty($params['info']) ? $params['info'] : null;
                 CjBlogApi::award_points($params['function'], $userid, $points, $reference, $description);
             }
             break;
         case 'jomsocial':
             $api = JPATH_SITE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'userpoints.php';
             if (file_exists($api) && !empty($params['function'])) {
                 include_once $api;
                 CuserPoints::assignPoint($params['function'], $userid);
             }
             break;
         case 'aup':
             $api = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
             if (file_exists($api) && !empty($params['function']) && isset($params['info'])) {
                 require_once $api;
                 $reference = !empty($params['reference']) ? $params['reference'] : null;
                 $aupid = AlphaUserPointsHelper::getAnyUserReferreID($userid);
                 AlphaUserPointsHelper::newpoints($params['function'], $aupid, $reference, $params['info'], $params['points']);
             }
             break;
         case 'touch':
             $api = JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'api.php';
             if (file_exists($api) && !empty($params['points'])) {
                 require_once $api;
                 JSCommunityApi::increaseKarma($userid, $params['points']);
             }
             break;
         case 'easysocial':
             $api = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_easysocial' . DS . 'includes' . DS . 'foundry.php';
             if (file_exists($api)) {
                 require_once $api;
                 Foundry::points()->assign($params['function'], $params['component'], $userid);
             }
             break;
     }
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:60,代码来源:functions.php

示例15: onAfterThankyou

	public function onAfterThankyou($target, $actor, $message) {
		$infoTargetUser = (JText::_ ( 'COM_KUNENA_THANKYOU_GOT' ).': ' . KunenaFactory::getUser($target)->username );
		$infoRootUser = ( JText::_ ( 'COM_KUNENA_THANKYOU_SAID' ).': ' . KunenaFactory::getUser($actor)->username );
		$category = $message->getCategory();
		if ($category->pub_access == 0 || $category->pub_access == - 1) {
			$auptarget = AlphaUserPointsHelper::getAnyUserReferreID( $target );
			$aupactor = AlphaUserPointsHelper::getAnyUserReferreID( $actor );

			if ( $this->_getAUPversion() < '1.5.12' ) {
				$ruleName = 'plgaup_thankyou_kunena';
				$ruleEnabled = AlphaUserPointsHelper::checkRuleEnabled( $ruleName );
				$usertargetpoints = intval($ruleEnabled[0]->content_items);
			} elseif ( $this->_getAUPversion() >= '1.5.12' ) {
				$ruleName = 'plgaup_kunena_message_thankyou';
				$ruleEnabled = AlphaUserPointsHelper::checkRuleEnabled( $ruleName );
				$usertargetpoints = intval($ruleEnabled[0]->content_items);
			} else {
				return;
			}

			if ( $usertargetpoints && $ruleEnabled ) {
				// 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:rich20,项目名称:Kunena,代码行数:28,代码来源:activity.php


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