本文整理汇总了PHP中AlphaUserPointsHelper::getMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP AlphaUserPointsHelper::getMethod方法的具体用法?PHP AlphaUserPointsHelper::getMethod怎么用?PHP AlphaUserPointsHelper::getMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AlphaUserPointsHelper
的用法示例。
在下文中一共展示了AlphaUserPointsHelper::getMethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkReference
public static function checkReference($referrerid, $keyreference, $ruleid)
{
$db = JFactory::getDBO();
$plugin_function = AlphaUserPointsHelper::getPluginFunction($ruleid);
$method = AlphaUserPointsHelper::getMethod($plugin_function);
switch ($method) {
case '3':
$query = "SELECT count(*) FROM #__alpha_userpoints_details WHERE `keyreference`='{$keyreference}' AND `rule`='{$ruleid}'";
break;
default:
$query = "SELECT count(*) FROM #__alpha_userpoints_details WHERE `referreid`='{$referrerid}' AND `keyreference`='{$keyreference}' AND `rule`='{$ruleid}'";
}
$db->setQuery($query);
$resultKeyReference = $db->loadResult();
// Build Key Reference change on format date version 1.9.3
$resultKeyReference = str_replace('%', '', $resultKeyReference);
return $resultKeyReference;
}
示例2: 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);
}
}
}
}
}