本文整理汇总了PHP中AlphaUserPointsHelper::getCurrentTotalPoints方法的典型用法代码示例。如果您正苦于以下问题:PHP AlphaUserPointsHelper::getCurrentTotalPoints方法的具体用法?PHP AlphaUserPointsHelper::getCurrentTotalPoints怎么用?PHP AlphaUserPointsHelper::getCurrentTotalPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AlphaUserPointsHelper
的用法示例。
在下文中一共展示了AlphaUserPointsHelper::getCurrentTotalPoints方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: operationIsFeasible
public static function operationIsFeasible($referreid = '', $numpoints)
{
if (!$referreid) {
return;
}
$currentpoints = AlphaUserPointsHelper::getCurrentTotalPoints($referreid);
$newtotal = $currentpoints + $numpoints;
if ($newtotal >= 0) {
return true;
} else {
return false;
}
}
示例2: foreach
}
echo '</tbody></table>';
echo '<div class="pagination" >';
echo $this->pagination->getResultsCounter();
echo $this->pagination->getPagesLinks();
echo $this->pagination->getPagesCounter();
echo '</div>';
echo JHtml::_('bootstrap.endTab');
}
if (!$use_as_catalog && $show_pointstab) {
echo JHtml::_('bootstrap.addTab', 'dashboardTab', 'mypoints', '<i class="vmv-icon-star"></i> ' . JText::_('COM_VMVENDOR_DASHBOARD_MYPOINTSTITLE'));
if ($use_aup = 0 && file_exists(JPATH_SITE . '/components/com_alphauserpoints/helper.php')) {
require_once $api_AUP;
$listActivity = AlphaUserPointsHelper::getListActivity('VMVendor', $user->id, $app->getCfg('list_limit'));
$ref = AlphaUserPointsHelper::getAnyUserReferreID($user->id);
echo '<div id="points_div"><h3>' . JText::_('COM_VMVENDOR_DASHBOARD_POINTS') . ' ' . AlphaUserPointsHelper::getCurrentTotalPoints($ref) . '</h3></div>';
if (count($listActivity) > 0) {
echo '<table class="table table-striped table-condensed table-hover table-bordered"><thead>';
echo '<tr ><th width="15%">';
echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_DATE');
echo '</th><th width="30%">';
echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_ACTION');
echo '</th><th >';
echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_AMOUNT');
echo '</th><th width="70%">';
echo JText::_('COM_VMVENDOR_DASHBOARD_AUP_DETAIL');
echo '</th></tr></thead><tbody>';
$i = 0;
foreach ($listActivity as $activity) {
echo '<tr><td>';
echo '<span style="color:#333;">' . JHTML::_('date', $activity->insert_date, JText::_($date_display)) . '</span><br /><span style="color:#777;font-style:oblique;">' . JHTML::_('date', $activity->insert_date, JText::_('H:i:s')) . '</span>';
示例3: getUserpoints
/**
* Gets alpha user points
*
* @param void
* @return $userpoints int
*/
function getUserpoints()
{
// get alphauserpoints for the user
$api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
if (file_exists($api_AUP)) {
require_once $api_AUP;
$referrerid = $this->getReferreid(JFactory::getUser()->id);
$userpoints = AlphaUserPointsHelper::getCurrentTotalPoints($referrerid);
}
return $userpoints;
}
示例4: onContentPrepare
public function onContentPrepare($context, &$article, &$params, $limitstart)
{
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$user = JFactory::getUser();
$print = JFactory::getApplication()->input->get('print', '');
$format = JFactory::getApplication()->input->get('format', '');
$aupraffleid = JFactory::getApplication()->input->get('aupraffleid', 0, 'int');
$aupraffleuserid = JFactory::getApplication()->input->get('aupraffleuserid', 0, 'int');
$auprafflepoints = JFactory::getApplication()->input->get('auprafflepoints', 0, 'FLOAT');
$auprafflepointsremove = JFactory::getApplication()->input->get('auprafflepointsremove', 0, 'FLOAT');
$multipleentries = JFactory::getApplication()->input->get('multipleentries', 0, 'int');
// ---
// if referral draw system
$referredraw2 = JFactory::getApplication()->input->get('referredraw2', 0, 'int');
$draw2 = JFactory::getApplication()->input->get('draw2', 0, 'int');
//$showlink = JFactory::getApplication()->input->get('showlink', 0, 'int');
// ---
$uri = JURI::getInstance();
@$uri->delVar('referrer');
@$uri->delVar('draw');
$url = $uri->toString();
$inscription = 0;
$pointstoparticipate = 0;
$removepointstoparticipate = 0;
if ($print || $format == 'pdf') {
$article->text = preg_replace(" |{AUP::RAFFLE=(.*)}| ", "", $article->text);
return;
}
if ($app->isAdmin()) {
return;
}
$lang = JFactory::getLanguage();
$lang->load('com_alphauserpoints', JPATH_SITE);
$jnow = JFactory::getDate();
$now = $jnow->toSql();
$api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
require_once $api_AUP;
if (preg_match('#{AUP::RAFFLE=(.*)}#Uis', $article->text, $m) && !$aupraffleid) {
$raffleid = $m[1];
if ($raffleid == 'ID') {
// default sample
return;
}
$query = "SELECT * FROM #__alpha_userpoints_raffle WHERE `id`='{$raffleid}' AND `published`='1'";
$db->setQuery($query);
$result = $db->loadObjectList();
if ($result) {
$inscription = $result[0]->inscription;
$pointstoparticipate = $result[0]->pointstoparticipate;
$removepointstoparticipate = $result[0]->removepointstoparticipate;
$multipleentries = $result[0]->multipleentries;
$alreadyProceeded = $result[0]->winner1;
$limitdate = $result[0]->raffledate;
if ($now > $limitdate) {
$alreadyProceeded = 1;
}
}
// You can choose number subscriptions members
//$query = "SELECT COUNT(DISTINCT userid) FROM #__alpha_userpoints_raffle_inscriptions WHERE `raffleid`='$raffleid'";
// You can choose number of tickets sold!
$query = "SELECT COUNT(id) FROM #__alpha_userpoints_raffle_inscriptions WHERE `raffleid`='{$raffleid}'";
$db->setQuery($query);
$num_subscription = $db->loadResult();
$article->text .= "\n<p>" . JText::_('AUP_NUMBER_SUBSCRIPTION_CURRENT_RAFFLE') . " " . $num_subscription . "</p>\n";
if ($inscription && $user->id && $alreadyProceeded == 0) {
if (!$multipleentries) {
$query = "SELECT userid FROM #__alpha_userpoints_raffle_inscriptions WHERE `userid`='{$user->id}' AND `raffleid`='{$raffleid}'";
$db->setQuery($query);
$userid = $db->loadResult();
} else {
$userid = 0;
}
if (!$userid) {
$referredraw = '';
$draw = 0;
if (isset($_COOKIE['referredraw'])) {
$referredraw = $_COOKIE['referredraw'];
$referredraw = AlphaUserPointsHelper::getUserID($referredraw);
}
if (isset($_COOKIE['draw'])) {
$draw = $_COOKIE['draw'];
}
$registrationForm = "\n<form action=\"{$url}\" method=\"post\" name=\"RaffleForm\">\n" . "<input type=\"hidden\" name=\"aupraffleid\" id=\"aupraffleid\" value=\"" . $raffleid . "\" />\n" . "<input type=\"hidden\" name=\"aupraffleuserid\" id=\"aupraffleuserid\" value=\"" . $user->id . "\" />\n" . "<input type=\"hidden\" name=\"auprafflepoints\" id=\"auprafflepoints\" value=\"" . $pointstoparticipate . "\" />\n" . "<input type=\"hidden\" name=\"auprafflepointsremove\" id=\"auprafflepointsremove\" value=\"" . $removepointstoparticipate . "\" />\n" . "<input type=\"hidden\" name=\"multipleentries\" id=\"multipleentries\" value=\"" . $multipleentries . "\" />\n" . "<input type=\"hidden\" name=\"referredraw2\" id=\"referredraw2\" value=\"" . $referredraw . "\" />\n" . "<input type=\"hidden\" name=\"draw2\" id=\"draw2\" value=\"" . $draw . "\" />\n" . "<input class=\"button\" type=\"submit\" name=\"Submit\" value=\"" . JText::_('AUP_SIGNUP_FOR_THIS_RAFFLE_NOW') . "\" />\n" . "</form>\n";
if ($pointstoparticipate) {
$referreid = AlphaUserPointsHelper::getAnyUserReferreID($user->id);
$currentpoints = AlphaUserPointsHelper::getCurrentTotalPoints($referreid);
if ($currentpoints >= $pointstoparticipate) {
$article->text .= $registrationForm;
} else {
$article->text .= "<p>" . JText::_('AUP_YOUDONOTHAVEENOUGHPOINTSTOPERFORMTHISOPERATION') . "</p>";
}
} else {
$article->text .= $registrationForm;
}
} else {
$article->text .= "<p>" . JText::_('AUP_ALREADY_REGISTERED_FOR_THIS_RAFFLE') . "</p>";
}
} elseif ($inscription && $user->id && $alreadyProceeded > 0) {
$article->text .= "<p>" . JText::_('AUP_DRAW_HAS_BEEN_MADE_YOU_CANT_REGISTER') . "</p>";
//.........这里部分代码省略.........