本文整理汇总了PHP中AlphaUserPointsHelper类的典型用法代码示例。如果您正苦于以下问题:PHP AlphaUserPointsHelper类的具体用法?PHP AlphaUserPointsHelper怎么用?PHP AlphaUserPointsHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AlphaUserPointsHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: getList
public static function getList($params)
{
$db = JFactory::getDBO();
$user = JFactory::getUser();
$count = intval($params->get('count', 5));
$usrname = trim($params->get('usrname', 'name'));
$allmembers = intval($params->get('showallmembers', 1));
$nullDate = $db->getNullDate();
$date = JFactory::getDate();
$now = $date->toSql();
$currentuser = $user->id;
$selecteduser = "";
if ($currentuser && !$allmembers) {
$selecteduser = "AND u.id='" . $currentuser . "' ";
}
$displayactivity = '';
require_once JPATH_ROOT . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
$version = AlphaUserPointsHelper::getAupVersion();
if (version_compare($version, '2.0.2', '>=')) {
$displayactivity = " AND r.displayactivity='1'";
}
$query = "SELECT a.insert_date, a.referreid, aup.userid, a.points AS last_points, a.datareference, u." . $usrname . " AS usrname, r.rule_name, r.plugin_function, r.category" . " FROM #__alpha_userpoints_details AS a, #__alpha_userpoints AS aup, #__users AS u, #__alpha_userpoints_rules AS r" . " WHERE aup.referreid=a.referreid " . $selecteduser . "AND aup.userid=u.id AND aup.published='1' AND a.approved='1' AND (a.expire_date>='" . $now . "' OR a.expire_date='0000-00-00 00:00:00') AND r.id=a.rule" . $displayactivity . " ORDER BY a.insert_date DESC";
$db->setQuery($query, 0, $count);
$rows = $db->loadObjectList();
return $rows;
}
开发者ID:q0821,项目名称:esportshop,代码行数:26,代码来源:helper.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: getPoint
function getPoint($user_id)
{
require_once JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
$profile = AlphaUserPointsHelper::getUserInfo('', $user_id);
$point = $profile->points;
return $point;
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:7,代码来源:alphauserpoints.class.php
示例5: 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
示例6: sendNotificationOnUpdateRank
private function sendNotificationOnUpdateRank($userinfo, $result)
{
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
$lang->load('com_alphauserpoints', JPATH_SITE);
jimport('joomla.mail.helper');
require_once JPATH_ROOT . '/components/com_alphauserpoints/helper.php';
// get params definitions
$params = JComponentHelper::getParams('com_alphauserpoints');
$jsNotification = $params->get('jsNotification', 0);
$jsNotificationAdmin = $params->get('fromIdUddeim', 0);
$SiteName = $app->getCfg('sitename');
$MailFrom = $app->getCfg('mailfrom');
$FromName = $app->getCfg('fromname');
$sef = $app->getCfg('sef');
$email = $userinfo->email;
$subject = $result->emailsubject;
$body = $result->emailbody;
$formatMail = $result->emailformat;
$bcc2admin = $result->bcc2admin;
$subject = str_replace('{username}', $userinfo->username, $subject);
$subject = str_replace('{points}', AlphaUserPointsHelper::getFPoints($userinfo->points), $subject);
$body = str_replace('{username}', $userinfo->username, $body);
$body = str_replace('{points}', AlphaUserPointsHelper::getFPoints($userinfo->points), $body);
$subject = JMailHelper::cleanSubject($subject);
if (!$jsNotification) {
$mailer = JFactory::getMailer();
$mailer->setSender(array($MailFrom, $FromName));
$mailer->setSubject($subject);
$mailer->isHTML((bool) $formatMail);
$mailer->CharSet = "utf-8";
$mailer->setBody($body);
$mailer->addRecipient($email);
if ($bcc2admin) {
// get all users allowed to receive e-mail system
$query = "SELECT email" . " FROM #__users" . " WHERE sendEmail='1' AND block='0'";
$db->setQuery($query);
$rowsAdmins = $db->loadObjectList();
foreach ($rowsAdmins as $rowsAdmin) {
$mailer->addBCC($rowsAdmin->email);
}
}
$send = $mailer->Send();
} else {
require_once JPATH_ROOT . '/components/com_community/libraries/core.php';
$params = new CParameter('');
CNotificationLibrary::add('system_messaging', $jsNotificationAdmin, $userinfo->id, $subject, $body, '', $params);
if ($bcc2admin) {
// get all users allowed to receive e-mail system
$query = "SELECT id" . " FROM #__users" . " WHERE sendEmail='1' AND block='0'";
$db->setQuery($query);
$rowsAdmins = $db->loadObjectList();
foreach ($rowsAdmins as $rowsAdmin) {
$mailer->addBCC($rowsAdmin->id);
CNotificationLibrary::add('system_messaging', $userinfo->id, $rowsAdmin->id, $subject, $body, '', $params);
}
}
}
}
开发者ID:q0821,项目名称:esportshop,代码行数:59,代码来源:notification_rank_medal.php
示例7: getDisplayTab
function getDisplayTab($tab,$user,$ui)
{
$params=$this->params;
global $_CB_framework,$_CB_database;
$livesite = JURI::base();
JPlugin::loadLanguage( 'com_alphauserpoints', JPATH_SITE );
$tableclass = $params->get('tableclass', 1);
$count_activity = $params->get('count_activity', 20);
$return ="";
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP)) {
require_once ($api_AUP);
$listActivity = AlphaUserPointsHelper::getListActivity('all', $user->id, $count_activity);
}
if(count($listActivity) >0) {
$return .='<table width="95%" cellspacing="0" border="0">';
$return .= '<tr class=\'sectiontableheader\'><th>';
$return .='</th><th width="20%">';
$return .= JText::_( 'AUP_DATE' );
$return .='</th><th width="20%">';
$return .= JText::_( 'AUP_ACTION' );
$return .='</th><th width="6%">';
$return .= JText::_( 'AUP_POINTS_UPPER' );
$return .='</th><th>';
$return .= JText::_( 'AUP_DETAIL' );
$return .='</th></tr>';
$i=0;
foreach ( $listActivity as $activity ) {
$i++;
if($i>2) $i=1;
$return .='<tr';
if($tableclass) $return .=' class="sectiontableentry'.$i.'"';
$return .=' ><td>';
$icon = ( $activity->category!='' ) ? '<img src="'.JURI::base(true).DS.'components'.DS.'com_alphauserpoints'.DS.'assets'.DS.'images'.DS.'categories'.DS.$activity->category.'.gif" alt="" />' : '';
$return .= $icon;
$return .='</td><td>';
$return .= '<span style="color:#333;">'.JHTML::_('date', $activity->insert_date, JText::_('d.m.Y')).'</span> <span style="color:#777;font-style:oblique;">'.JHTML::_('date', $activity->insert_date, JText::_('H:i:s')).'</span>';
$color = $activity->points>0 ? "#009900" : ($activity->points<0 ? "#ff0000" : ($activity->points==0.00 ? "#777" : "#777"));
$return .='</td><td style="color:'. $color .';">';
$return .= JText::_( $activity->rule_name );
$return .='</td><td style="text-align: right; color:'. $color .';">';
$return .= $activity->points;
$return .=' </td><td style="color:#777;">';
$return .= $activity->datareference;
$return .='</td></tr>';
}
$return .='</table>';
$return .= '<br />' . JHTML::_('date', 'now', JText::_('l d.m.Y H:i'));
} else $return .='<div align="center"><p>'.JText::_( 'AUP_THIS_INFORMATION_HAS_NOT_BEEN_PROVIDED' ).'</p></div>';
return $return;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:56,代码来源:aupactivity.php
示例8: 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
示例9: 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
示例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 ) : '';
$AUP_itemid = AlphaUserPointsHelper::getItemidAupProfil ();
return JRoute::_ ( 'index.php?option=com_alphauserpoints&view=account' . $userid . '&Itemid=' . $AUP_itemid, $xhtml );
}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:11,代码来源:profile.php
示例11: 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
示例12: 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
示例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: getLink
public function getLink($user, $class = '', $sizex = 90, $sizey = 90)
{
$user = KunenaFactory::getUser($user);
$size = $this->getSize($sizex, $sizey);
if ($size->y > 100) {
$avatar = AlphaUserPointsHelper::getAupAvatar($user->userid, 0, 100 * (double) $size->x / (double) $size->y, '100');
} else {
$avatar = AlphaUserPointsHelper::getAupAvatar($user->userid, 0, $size->x, $size->y);
}
if (!$avatar) {
$avatar = '<img border="0" width="100" height="100" alt="" src="' . JUri::root() . 'components/com_alphauserpoints/assets/images/avatars/generic_gravatar_grey.png">';
}
return $avatar;
}
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:14,代码来源:avatar.php
示例15: getLink
public function getLink($user, $class='', $sizex=90, $sizey=90)
{
$user = KunenaFactory::getUser($user);
$size = $this->getSize($sizex, $sizey);
if ($size->y > 100) {
$avatar = AlphaUserPointsHelper::getAupAvatar ( $user->userid, 0, 100*(float)$size->x/(float)$size->y, '100' );
} else {
$avatar = AlphaUserPointsHelper::getAupAvatar ( $user->userid, 0, $size->x, $size->y );
}
if (!$avatar) {
// FIXME: need a better way to do this
$avatar = '<img border="0" width="100" height="100" alt="" src="http://kunena16cb/components/com_alphauserpoints/assets/images/avatars/generic_gravatar_grey.gif">';
}
return $avatar;
}
开发者ID:rich20,项目名称:Kunena,代码行数:15,代码来源:avatar.php
示例16: getRanks
public function getRanks($userId)
{
$config = EasyBlogHelper::getConfig();
if (!$config->get('main_alpha_userpoint_ranks')) {
return false;
}
if (!$this->loadHelper()) {
return false;
}
if (!method_exists('AlphaUserPointsHelper', 'getUserRank')) {
return false;
}
$rank = AlphaUserPointsHelper::getUserRank('', $userId);
$theme = new CodeThemes();
$theme->set('rank', $rank);
return $theme->fetch('author.aup.ranks.php');
}
开发者ID:Tommar,项目名称:vino2,代码行数:17,代码来源:aup.php
示例17: 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
示例18: 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>√</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
示例19: validerRadio
function validerRadio($db)
{
$api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
if (file_exists($api_AUP)) {
require_once $api_AUP;
$query = "SELECT id_user FROM #__mzpromoradio where valide='0' GROUP BY id_user";
$db->setQuery($query);
$users = $db->loadResultArray();
foreach ($users as $u) {
$u = (int) $u;
//$referreid = AlphaUserPointsHelper::getAnyUserReferreID( $u );
$profil = AlphaUserPointsHelper::getUserInfo('', $u);
if ($profil->points > 299) {
$query = "UPDATE #__mzpromoradio SET valide='1' WHERE id_user='{$u}'";
$db->setQuery($query);
$test = $db->query();
}
}
}
}
开发者ID:halbo5,项目名称:com_mzpromoradio,代码行数:20,代码来源:mzpromoradio.php
示例20: _display
function _display($tpl = null)
{
$document = JFactory::getDocument();
$lang = $document->getLanguage();
$displ = "view";
$points = 0;
JHtml::_('behavior.framework', true);
$document->addStyleSheet(JURI::base(true) . '/components/com_alphauserpoints/assets/css/alphauserpoints.css');
require_once JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
$result = AlphaUserPointsHelper::checkRuleEnabled('sysplgaup_invite');
if ($result) {
$points = $result[0]->points;
}
JHTML::_('behavior.formvalidation');
// reCaptcha script
if ($this->params->get('userecaptcha', 1)) {
if ($this->params->get('recaptchaajax ', 0)) {
$document->addScript("http://api.recaptcha.net/js/recaptcha_ajax.js");
$paramsReCaptcha = "\r\n\t\t\t\t\twindow.onload = function () {\r\n\t\t\t\t\tRecaptcha.create('" . $this->params->get('pubkey') . "',\r\n\t\t\t\t\t'recaptcha_div', {\r\n\t\t\t\t\t theme: '" . $this->params->get('themerecaptcha', 'red') . "',\r\n\t\t\t\t\t callback: Recaptcha.focus_response_field\r\n\t\t\t\t\t});\r\n\t\t\t\t\t}";
} else {
$paramsReCaptcha = "\r\n\t\t\t\tvar RecaptchaOptions = {\r\n\t\t\t\t theme : '" . $this->params->get('themerecaptcha', 'red') . "',\r\n\t\t\t\t lang : '" . substr($lang, 0, 2) . "'\r\n\t\t\t\t};\r\n\t\t\t\t";
}
$document->addScriptDeclaration($paramsReCaptcha, '');
}
/*
$document->addScript(JURI::base(true).'/media/system/js/mootools-core.js');
$document->addStyleSheet(JURI::base(true).'/media/system/css/modal.css');
$document->addScript(JURI::base(true).'/media/system/js/modal.js');
*/
JHTML::_('behavior.modal');
$setModal = "window.addEvent('domready', function() {\r\n\t\t\tSqueezeBox.initialize({});\r\n\r\n\t\t\t\$\$('a.modal').each(function(el) {\r\n\t\t\t\tel.addEvent('click', function(e) {\r\n\t\t\t\t\tnew Event(e).stop();\r\n\t\t\t\t\tSqueezeBox.fromElement(el);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t\t";
$document->addScriptDeclaration($setModal);
$this->assignRef('params', $this->params);
$this->assignRef('referreid', $this->referreid);
$this->assignRef('user_name', $this->user_name);
$this->assignRef('points', $points);
$this->assignRef('displ', $displ);
$this->assignRef('referrer_link', $this->referrer_link);
parent::display($tpl);
}
开发者ID:q0821,项目名称:esportshop,代码行数:40,代码来源:view.html.php
注:本文中的AlphaUserPointsHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论