當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AlphaUserPointsHelper::getNameRule方法代碼示例

本文整理匯總了PHP中AlphaUserPointsHelper::getNameRule方法的典型用法代碼示例。如果您正苦於以下問題:PHP AlphaUserPointsHelper::getNameRule方法的具體用法?PHP AlphaUserPointsHelper::getNameRule怎麽用?PHP AlphaUserPointsHelper::getNameRule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AlphaUserPointsHelper的用法示例。


在下文中一共展示了AlphaUserPointsHelper::getNameRule方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkTiendaPaymentRule

 /**
  * Checks AlphaUserPoints for Tienda payment
  * 
  * @param void
  * @return void
  */
 function checkTiendaPaymentRule()
 {
     $api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
     if (file_exists($api_AUP)) {
         require_once $api_AUP;
         $referrerid = $this->getReferreid(JFactory::getUser()->id);
         $rule_name = AlphaUserPointsHelper::getNameRule($this->_element);
         if (empty($rule_name)) {
             JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_alphauserpoints/tables');
             // save new points into alpha_userpoints_rules table
             $row = JTable::getInstance('Rules');
             $row->id = NULL;
             $row->rule_name = 'Tienda Payment';
             $row->rule_description = 'Rule for substraction points during Tienda payment';
             $row->rule_plugin = 'Tienda Payment';
             $row->plugin_function = $this->_element;
             $row->component = 'com_tienda';
             $row->calltask = '';
             $row->taskid = '';
             $row->category = '';
             if (!$row->store()) {
                 JError::raiseError(500, $row->getError());
             }
         }
     }
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:32,代碼來源:payment_alphauserpoints.php

示例2: insertUserPoints

 public static function insertUserPoints($referrerid, $result, $referraluserpoints = 0, $keyreference = '', $datareference = '', $frontmessage = '')
 {
     $jnow = JFactory::getDate();
     $now = $jnow->toSql();
     $points = $result->points;
     $rule_expire = AlphaUserPointsHelper::checkRuleExpireDate($result->rule_expire, $result->type_expire_date);
     $rule_id = $result->id;
     $autoapproved = $result->autoapproved;
     $rule_plugin = $result->plugin_function;
     $rule_name = $result->rule_name;
     $noupdate = 0;
     // get params definitions
     $params = JComponentHelper::getParams('com_alphauserpoints');
     $insertAllActivities = $params->get('insertAllActivities', 0);
     if ($insertAllActivities) {
         if (!$referrerid) {
             return;
         }
     } else {
         if (!$referrerid || $points == 0) {
             return;
         }
     }
     $points = $referraluserpoints > 0 ? $referraluserpoints : $points;
     // load external plugins
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('alphauserpoints');
     $results = $dispatcher->trigger('onBeforeInsertUserActivityAlphaUserPoints', array(&$result, $points, $referrerid, $keyreference, $datareference));
     JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'tables');
     // save new points into alpha_userpointsdetails table
     $row = JTable::getInstance('userspointsdetails');
     $row->id = NULL;
     $row->referreid = $referrerid;
     $row->points = $points;
     $row->insert_date = $now;
     $row->expire_date = $rule_expire;
     $row->rule = $rule_id;
     $row->approved = $autoapproved;
     $row->status = $autoapproved;
     $row->keyreference = $keyreference;
     $row->datareference = $datareference;
     if (!$row->store()) {
         JError::raiseError(500, $row->getError());
     }
     if ($noupdate) {
         return;
     }
     if ($referrerid != 'GUEST' || $referraluserpoints > 0) {
         if ($rule_plugin == '') {
             $rule_plugin = AlphaUserPointsHelper::getPluginFunction($rule_id);
         }
         if ($rule_name == '') {
             $rule_name = AlphaUserPointsHelper::getNameRule($rule_plugin);
         }
         AlphaUserPointsHelper::updateUserPoints($result, $referrerid, $points, $now, $referraluserpoints, $autoapproved, $rule_plugin, $rule_id, $rule_name, $datareference, $frontmessage);
     }
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:57,代碼來源:helper.php

示例3: checkTiendaAwardRule

 /**
  * Checks AlphaUserPoints for Tienda payment
  * 
  * @param void
  * @return void
  */
 function checkTiendaAwardRule()
 {
     $api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
     if (file_exists($api_AUP)) {
         require_once $api_AUP;
         $referrerid = $this->getReferreid(JFactory::getUser()->id);
         $rule_name = AlphaUserPointsHelper::getNameRule($this->_element);
         if (empty($rule_name)) {
             JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_alphauserpoints/tables');
             // save new points into alpha_userpoints_rules table
             $row = JTable::getInstance('Rules');
             $row->id = NULL;
             $row->rule_name = 'Tienda Award AlphaUserPoints';
             $row->rule_description = 'Rule for awarding points on Tienda action';
             $row->rule_plugin = 'Tienda Award AlphaUserPoints';
             $row->plugin_function = $this->_element;
             $row->component = 'com_tienda';
             $row->calltask = '';
             $row->taskid = '';
             $row->category = '';
             if (!$row->store()) {
                 JFactory::getApplication()->enqueueMessage($row->getError(), 'notice');
             }
         }
     }
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:32,代碼來源:award_alphauserpoints.php


注:本文中的AlphaUserPointsHelper::getNameRule方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。