本文整理汇总了PHP中AlphaUserPointsHelper::getUserInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP AlphaUserPointsHelper::getUserInfo方法的具体用法?PHP AlphaUserPointsHelper::getUserInfo怎么用?PHP AlphaUserPointsHelper::getUserInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AlphaUserPointsHelper
的用法示例。
在下文中一共展示了AlphaUserPointsHelper::getUserInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: getPoints
public function getPoints($userId)
{
$config = EasyBlogHelper::getConfig();
if (!$config->get('main_alpha_userpoint_points')) {
return false;
}
if (!$this->loadHelper()) {
return false;
}
$info = AlphaUserPointsHelper::getUserInfo('', $userId);
if (!$info) {
return '';
}
return JText::sprintf('COM_EASYBLOG_AUP_POINTS_EARNED', $info->points);
}
示例4: _get_referrees
function _get_referrees($referrerid)
{
$db = JFactory::getDBO();
$query = "SELECT * FROM #__alpha_userpoints WHERE referraluser='{$referrerid}'";
$db->setQuery($query);
$rowsreferrees = $db->loadObjectList();
if ($rowsreferrees) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
for ($i = 0, $n = count($rowsreferrees); $i < $n; $i++) {
$UserInfo = AlphaUserPointsHelper::getUserInfo($rowsreferrees[$i]->referreid);
$username = $UserInfo->username;
$name = $UserInfo->name;
$rowsreferrees[$i]->username = $username;
$rowsreferrees[$i]->name = $name;
}
}
return $rowsreferrees;
}
示例5: 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();
}
}
}
}
示例6: getProfileLink
}
echo $linktoprofil;
?>
</td>
<?php
}
?>
<?php
if ($this->params->get('show_username_cols', 1) || !$this->params->get('show_name_cols') && !$this->params->get('show_username_cols')) {
?>
<td headers="categorylist_header_title" class="list-title">
<?php
if ($this->params->get('show_links_to_users', 1)) {
$_user_info = AlphaUserPointsHelper::getUserInfo($row->referreid);
$linktoprofil = getProfileLink($_profilelink, $_user_info);
$linktoprofil = "<a href=\"" . JRoute::_($linktoprofil) . "\">" . $row->username . "</a>";
} else {
$linktoprofil = $row->username;
}
echo $linktoprofil;
?>
</td>
<?php
}
?>
<td headers="categorylist_header_title" class="list-title">
<div class="progress progress-striped active">
<div class="bar" style="width: <?php
示例7: getAvatar
function getAvatar($userId,$wallversion)
{
$path=JURI::base();
$temp='plugins/content/loadjomwall/';
$path=str_replace($temp,'',$path);
$db =& JFactory::getDBO();
$app = JFactory::getApplication('site');
$config = & $app->getParams('com_awdwall');
$template = $config->get('temp', 'blue');
$avatarintergration = $config->get('avatarintergration', '0');
$query = "SELECT facebook_id FROM #__jconnector_ids WHERE user_id = " . (int)$userId;
$db->setQuery($query);
$facebook_id = $db->loadResult();
if($facebook_id)
{
$avatar='https://graph.facebook.com/'.$facebook_id.'/picture?type=square';
}
else
{
$query = 'SELECT avatar FROM #__awd_wall_users WHERE user_id = ' . (int)$userId;
$db = & JFactory::getDBO();
$db->setQuery($query);
$img = $db->loadResult();
if($img == NULL){
$avatar = $path . "components/com_awdwall/images/".$template."/".$template."32.png";
}else{
$avatar = $path. "images/wallavatar/" . $userId . "/thumb/tn32" . $img;
}
}
if($avatarintergration==1) // k2
{
if(file_exists(JPATH_SITE . '/components/com_k2/k2.php'))
{
require_once (JPATH_SITE . '/components/com_k2/helpers/utilities.php');
$avatar=K2HelperUtilities::getAvatar($userId);
}
}
else if($avatarintergration==2) // easyblog
{
if(file_exists(JPATH_SITE . '/components/com_easyblog/easyblog.php'))
{
require_once (JPATH_SITE . '/components/com_easyblog/helpers/helper.php');
$blogger = EasyBlogHelper::getTable( 'Profile', 'Table');
$blogger->load( $userId );
$avatar=$blogger->getAvatar();
}
}
else if($avatarintergration==3) // alphauserpoint
{
if(file_exists(JPATH_SITE . '/components/com_alphauserpoints/alphauserpoints.php'))
{
require_once (JPATH_SITE . '/components/com_alphauserpoints/helper.php');
require_once (JPATH_SITE . '/components/com_alphauserpoints/helpers/helpers.php');
$_user_info = AlphaUserPointsHelper::getUserInfo ( $referrerid='', $userId );
$com_params = &JComponentHelper::getParams( 'com_alphauserpoints' );
$useAvatarFrom = $com_params->get('useAvatarFrom');
$height = 32;
$width=32;
$avatar = getAvatar( $useAvatarFrom, $_user_info, $height,$width);
$doc = new DOMDocument();
$doc->loadHTML($avatar);
$imageTags = $doc->getElementsByTagName('img');
foreach($imageTags as $tag) {
$avatar=$tag->getAttribute('src');
}
}
}
return $avatar;
}
示例8: foreach
$com_params = JComponentHelper::getParams('com_alphauserpoints');
$user = JFactory::getUser();
if ($list) {
if (!class_exists('AlphaUserPointsHelper')) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
}
$com_params = JComponentHelper::getParams('com_alphauserpoints');
$useAvatarFrom = $com_params->get('useAvatarFrom');
?>
<div>
<ul style="padding:0;margin:0;list-style: none;">
<?php
$i = 1;
foreach ($list as $item) {
$usrname = htmlspecialchars($item->usrname, ENT_QUOTES, 'UTF-8');
$userinfo = AlphaUserPointsHelper::getUserInfo($item->referreid);
$profil = getProfileLink($com_params->get('linkToProfile', ''), $item);
?>
<li style="background:none;padding:5px 0;border-bottom:solid 1px #ccc;list-style: none;">
<?php
if ($params->get('showavatar', 0)) {
?>
<div style="float:left;width:38px;">
<div style="padding:2px;border:solid 1px #ccc;">
<?php
echo getAvatar($useAvatarFrom, $userinfo, 32);
?>
</div>
</div>
<?php
$margin = 42;
示例9: checkUserPoints
/**
* Check whether a user may download the file, when AlphaUserPoints are used
*
* @param integer $sum_aup_price_points the sum of points from price field, for the requested files
* array $marked_files_id
*
* @return array
*/
public static function checkUserPoints($sum_aup_price_points, $marked_files_id)
{
global $jlistConfig;
$user = JFactory::getUser();
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$sum_aup_points = 0;
$aup_result = array();
$api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
if (file_exists($api_AUP)) {
require_once $api_AUP;
// get current user points - stored in $profil->points
$aup = new AlphaUserPointsHelper();
$profil = $aup->getUserInfo('', $user->id);
// get standard points value from AUP jDownloads rule
$db->setQuery("SELECT points FROM #__alpha_userpoints_rules WHERE published = 1 AND plugin_function = 'plgaup_jdownloads_user_download'");
$aup_fix_points = floatval($db->loadResult());
//$aup_fix_points = strToNumber($aup_fix_points);
if ($jlistConfig['use.alphauserpoints.with.price.field']) {
$sum_aup_points = $sum_aup_price_points;
} else {
// fis points for every download are used
$sum_aup_points = $aup_fix_points * count($marked_files_id);
// we need a positive value
if ($sum_aup_points < 0) {
$sum_aup_points = -$sum_aup_points;
}
}
if ($profil) {
// we have a member
if ($jlistConfig['user.can.download.file.when.zero.points']) {
// he can download it after all
$aup_result['points_info'] = sprintf(str_replace('%d', '%s', JText::_('COM_JDOWNLOADS_FE_VIEW_AUP_SUM_POINTS')), self::strToNumber($sum_aup_points), self::strToNumber($profil->points));
$aup_result['may_download'] = true;
} elseif ($sum_aup_points > 0 && $sum_aup_points <= $profil->points) {
// view it only when we have a result and user may download it
$aup_result['points_info'] = sprintf(str_replace('%d', '%s', JText::_('COM_JDOWNLOADS_FE_VIEW_AUP_SUM_POINTS')), self::strToNumber($sum_aup_points), self::strToNumber($profil->points));
$aup_result['may_download'] = true;
} elseif ($sum_aup_points > 0 && $sum_aup_points > $profil->points) {
// user may not download
$aup_result['points_info'] = '<div style="text-align:center" class="jd_div_aup_message">' . stripslashes(self::getOnlyLanguageSubstring($jlistConfig['user.message.when.zero.points'])) . '</div>' . '<div style="text-align:center" class="jd_div_aup_message">' . JText::_('COM_JDOWNLOADS_FE_SUMMARY_YOUR_POINTS') . ' ' . self::strToNumber($profil->points) . '<br />' . JText::_('COM_JDOWNLOADS_FE_SUMMARY_NEEDED_POINTS') . ' ' . self::strToNumber($sum_aup_points) . '</div>';
$aup_result['may_download'] = false;
} else {
// this download is free but we create still the user info, so the user can read that he costs nothing!
$aup_result['points_info'] = sprintf(str_replace('%d', '%s', JText::_('COM_JDOWNLOADS_FE_VIEW_AUP_SUM_POINTS')), abs($aup_fix_points * count($marked_files_id)), self::strToNumber($profil->points));
$aup_result['may_download'] = true;
}
} else {
if ($sum_aup_points > 0) {
// view it only when we have a result
// but we have here an unregistered visitor - he can not have aup points!
if ($jlistConfig['user.can.download.file.when.zero.points']) {
// he can download it after all
$aup_result['points_info'] = sprintf(str_replace('%d', '%s', JText::_('COM_JDOWNLOADS_FE_VIEW_AUP_SUM_POINTS')), self::strToNumber($sum_aup_points), 0);
$aup_result['may_download'] = true;
} else {
// now way to doenload it
$aup_result['points_info'] = sprintf(str_replace('%d', '%s', JText::_('COM_JDOWNLOADS_FE_VIEW_AUP_SUM_POINTS_FOR_VISITOR')), self::strToNumber($sum_aup_points), 0);
$aup_result['may_download'] = false;
}
} else {
// remove placeholder
$aup_result['points_info'] = '';
$aup_result['may_download'] = true;
}
}
} else {
$aup_result['points_info'] = '';
$aup_result['may_download'] = true;
}
return $aup_result;
}
示例10: check_user_credits
function check_user_credits($userid = 0)
{
$app = JFactory::getApplication();
if (!$userid) {
$user = JFactory::getUser();
$userid = $user->id;
}
$params = JComponentHelper::getParams(S_APP_NAME);
$points_per_credit = (int) $params->get('points_per_credit', 0);
if (!$points_per_credit) {
return -1;
}
switch ($params->get('points_system', 'none')) {
case 'cjblog':
$api = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_cjblog' . DIRECTORY_SEPARATOR . 'api.php';
if (file_exists($api)) {
include_once $api;
$profile = CjBlogApi::get_user_profile($userid);
if (!empty($profile)) {
return floor($profile['points'] / $points_per_credit);
}
}
break;
case 'aup':
$api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
if (file_exists($api_AUP)) {
require_once $api_AUP;
$profile = AlphaUserPointsHelper::getUserInfo('', $userid);
if (!empty($profile)) {
return floor($profile->points / $points_per_credit);
}
}
break;
case 'jomsocial':
$query = 'select points from #__community_users where userid=' . $userid;
$this->_db->setQuery($query);
$points = (int) $this->_db->loadResult();
return floor($points / $points_per_credit);
case 'easysocial':
$query = 'select sum(points) from #__social_points_history where user_id = ' . $userid . ' and state = 1';
$this->_db->setQuery($query);
$points = (int) $this->_db->loadResult();
return floor($points / $points_per_credit);
}
return -1;
}
示例11: display
public function display($cachable = false, $urlparams = false)
{
$app = JFactory::getApplication();
require_once JPATH_ROOT . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
$com_params = JComponentHelper::getParams('com_alphauserpoints');
$model = $this->getModel('alphauserpoints');
$view = $this->getView('account', 'html');
// current user
$user = JFactory::getUser();
// profil request
$userid = JFactory::getApplication()->input->get('userid', '', 'string');
if (!$user->id && !$com_params->get('allowGuestUserViewProfil', 1)) {
$msg = JText::_('ALERTNOTAUTH');
$this->setRedirect('index.php', $msg);
$this->redirect();
}
// check referre ID
if (!$userid) {
$referrerid = $model->_checkUser();
} else {
$referrerid = $userid;
}
// Rule Profile View
if ($referrerid != @$_SESSION['referrerid']) {
$keyreference = AlphaUserPointsHelper::buildKeyreference('sysplgaup_profile_view', $user->id);
$username = $user->username ? $user->username : JText::_('AUP_GUEST');
$datareference = JText::_('AUP_PROFILE_VIEW_REFERENCE') . ' ' . $username;
AlphaUserPointsHelper::userpoints('sysplgaup_profile_view', $referrerid, 0, $keyreference, $datareference);
}
// End rule Profile View
// Get the parameters of the active menu item
$params = $model->_getParamsAUP();
$num_item_activities = $params->get('num_item_activities', 10);
$_get_last_points = $model->_get_last_points($referrerid, $num_item_activities);
$_listing_last_points = $_get_last_points[0];
$_listing_total = $_get_last_points[1];
$_listing_limit = $_get_last_points[2];
$_listing_limitstart = $_get_last_points[3];
$rowsreferrees = $model->_get_referrees($referrerid);
$pointsearned = $model->_pointsearned();
// users points earned TOP 10
$totalpoints = $model->_totalpoints();
// entire community
$mypointsearned = $model->_mypointsearned($referrerid);
$mypointsspent = $model->_mypointsspent($referrerid);
$mypointsearnedthismonth = $model->_mypointsearnedthismonth($referrerid);
$mypointsspentthismonth = $model->_mypointsspentthismonth($referrerid);
$mypointsearnedthisday = $model->_mypointsearnedthisday($referrerid);
$mypointsspentthisday = $model->_mypointsspentthisday($referrerid);
$_average_age = _get_average_age_community();
$_user_info = AlphaUserPointsHelper::getUserInfo($referrerid);
$currenttotalpoints = $_user_info->points;
$lastupdate = $_user_info->last_update;
$referraluser = $_user_info->referraluser;
$myname = $_user_info->name;
$myusername = $_user_info->username;
$mybirthday = $_user_info->birthdate;
$referralname = "";
if ($referraluser) {
$referralinfo = AlphaUserPointsHelper::getUserInfo($referraluser);
$referralname = $referralinfo->username;
}
// get level/rank if exist
$userrankinfo = AlphaUserPointsHelper::getUserRank($referrerid);
// get medals if exist
$medalslistuser = AlphaUserPointsHelper::getUserMedals($referrerid);
// load avatar
$useAvatarFrom = $com_params->get('useAvatarFrom');
$height = 100;
if ($useAvatarFrom == 'alphauserpoints') {
$lang = JFactory::getLanguage();
$lang->load('com_media', JPATH_ADMINISTRATOR);
}
$avatar = getAvatar($useAvatarFrom, $_user_info, $height, $height, 'class="thumbnail"');
// Get coupons code
$resultCoupons = $model->_getMyCouponCode($referrerid);
$view->assign('params', $params);
$view->assign('cparams', $com_params);
$view->assign('referreid', $referrerid);
$view->assign('currenttotalpoints', $currenttotalpoints);
$view->assign('rowslastpoints', $_listing_last_points);
$view->assign('total', $_listing_total);
$view->assign('limit', $_listing_limit);
$view->assign('limitstart', $_listing_limitstart);
$view->assign('lastupdate', $lastupdate);
$view->assign('referraluser', $referraluser);
$view->assign('referralname', $referralname);
$view->assign('rowsreferrees', $rowsreferrees);
$view->assign('userid', $user->id);
$view->assign('userrankinfo', $userrankinfo);
$view->assign('medalslistuser', $medalslistuser);
$view->assign('pointsearned', $pointsearned);
$view->assign('totalpoints', $totalpoints);
$view->assign('mypointsearned', $mypointsearned);
$view->assign('mypointsspent', $mypointsspent);
$view->assign('mypointsearnedthismonth', $mypointsearnedthismonth);
$view->assign('mypointsspentthismonth', $mypointsspentthismonth);
$view->assign('mypointsearnedthisday', $mypointsearnedthisday);
$view->assign('mypointsspentthisday', $mypointsspentthisday);
$view->assign('myname', $myname);
//.........这里部分代码省略.........
示例12: getAvatar
//.........这里部分代码省略.........
}
break;
case 'clexus':
$query = "SELECT picture FROM #__mypms_profiles WHERE `name`='" . $userinfo->username . "'";
$db->setQuery($query);
$result = $db->loadResult();
if (!empty($result)) {
$avatar = $result;
} else {
$avatar = '';
}
break;
case 'K2':
$query = "SELECT image FROM #__k2_users WHERE userID='" . $userinfo->id . "'";
$db->setQuery($query);
$result = $db->loadResult();
if (!empty($result)) {
$avatar = JURI::base(true) . "/media/k2/users/" . $result;
} else {
$avatar = '';
}
break;
case 'alphauserpoints':
if (!defined("_AUP_AVATAR_LIVE_PATH")) {
define('_AUP_AVATAR_LIVE_PATH', JURI::base(true) . '/components/com_alphauserpoints/assets/images/avatars/');
}
$usr_avatar = $userinfo->avatar != '' ? JPATH_COMPONENT . DS . 'assets/images/avatars/' . $userinfo->avatar : JPATH_COMPONENT . DS . 'assets/images/avatars/generic_gravatar_grey.gif';
if (file_exists($usr_avatar)) {
$image = new JImage($usr_avatar);
$avatar = $image->createThumbs(array($width . 'x' . $height), JImage::CROP_RESIZE, JPATH_COMPONENT . DS . 'assets' . DS . 'images' . DS . 'avatars' . DS . 'thumbs');
$avatar = myImage::getLivePathImage($avatar);
} else {
$avatar = $defaultAvatarAUP;
}
break;
case 'jomWALL':
// for version 2.5
$config = JComponentHelper::getParams('com_awdwall');
$template = $config->get('temp', 'blue');
$avatarintergration = $config->get('avatarintergration', '0');
$query = "SELECT facebook_id FROM #__jconnector_ids WHERE user_id = " . (int) $userId;
$db->setQuery($query);
$facebook_id = $db->loadResult();
if ($facebook_id) {
$avatar = 'https://graph.facebook.com/' . $facebook_id . '/picture?type=large';
} else {
$query = 'SELECT avatar FROM #__awd_wall_users WHERE user_id = ' . (int) $userId;
$db = JFactory::getDBO();
$db->setQuery($query);
$img = $db->loadResult();
if ($img == NULL) {
$avatar = JURI::root() . "components/com_awdwall/images/" . $template . "/" . $template . "51.png";
} else {
$avatar = JURI::root() . "images/wallavatar/" . $userId . "/thumb/tn51" . $img;
}
}
if ($avatarintergration == 1) {
if (file_exists(JPATH_SITE . '/components/com_k2/k2.php')) {
require_once JPATH_SITE . '/components/com_k2/helpers/utilities.php';
$avatar = K2HelperUtilities::getAvatar($userId);
}
} else {
if ($avatarintergration == 2) {
if (file_exists(JPATH_SITE . '/components/com_easyblog/easyblog.php')) {
require_once JPATH_SITE . '/components/com_easyblog/helpers/helper.php';
$blogger = EasyBlogHelper::getTable('Profile', 'Table');
$blogger->load($userId);
$avatar = $blogger->getAvatar();
}
} else {
if ($avatarintergration == 3) {
if (file_exists(JPATH_SITE . '/components/com_alphauserpoints/alphauserpoints.php')) {
require_once JPATH_SITE . '/components/com_alphauserpoints/helper.php';
require_once JPATH_SITE . '/components/com_alphauserpoints/helpers/helpers.php';
$_user_info = AlphaUserPointsHelper::getUserInfo($referrerid = '', $userId);
$com_params = JComponentHelper::getParams('com_alphauserpoints');
$useAvatarFrom = $com_params->get('useAvatarFrom');
$height = 50;
$width = 50;
$avatar = getAvatar($useAvatarFrom, $_user_info, $height, $width);
$doc = new DOMDocument();
$doc->loadHTML($avatar);
$imageTags = $doc->getElementsByTagName('img');
foreach ($imageTags as $tag) {
$avatar = $tag->getAttribute('src');
}
}
}
}
}
default:
$avatar = '';
}
if ($avatar && $useAvatarFrom != 'gravatar' && $useAvatarFrom != 'jomsocial') {
$avatar = '<img src="' . $avatar . '" border="0" alt="" ' . $setheight . $setwidth . ' ' . $class . ' />';
} elseif ($useAvatarFrom == 'jomsocial') {
$avatar = '<img src="' . $avatar . '" border="0" alt="" ' . $setheight . $setwidth . ' />';
}
return $avatar;
}
示例13: sendnotification
function sendnotification($referrerid, $assignpoints, $newtotal, $result, $force = 0, $username = '')
{
$app = JFactory::getApplication();
if (!$referrerid || $referrerid == 'GUEST') {
return;
}
$db = JFactory::getDBO();
$user = JFactory::getUser($username);
jimport('joomla.mail.helper');
// get params definitions
$params = JComponentHelper::getParams('com_alphauserpoints');
$SiteName = $app->getCfg('sitename');
$MailFrom = $app->getCfg('mailfrom');
$FromName = $app->getCfg('fromname');
$sef = $app->getCfg('sef');
$userinfo = AlphaUserPointsHelper::getUserInfo($referrerid);
$email = $userinfo->email;
$rule_name = $result->rule_name;
$subject = $result->emailsubject;
$body = $result->emailbody;
$formatMail = $result->emailformat;
$bcc2admin = $result->bcc2admin;
if (!$userinfo->block || $force) {
if ($subject != '' && $body != '') {
$subject = str_replace('{username}', $user->username, $subject);
$subject = str_replace('{points}', abs($assignpoints), $subject);
$subject = str_replace('{newtotal}', $newtotal, $subject);
$body = str_replace('{username}', $user->username, $body);
$body = str_replace('{points}', abs($assignpoints), $body);
$body = str_replace('{newtotal}', $newtotal, $body);
} else {
if ($assignpoints > 0) {
$subject = JText::_('AUP_EMAILNOTIFICATION_SUBJECT');
$body = sprintf(JText::_('AUP_EMAILNOTIFICATION_MSG'), $SiteName, $assignpoints, $newtotal, JText::_($rule_name));
} elseif ($assignpoints < 0) {
$subject = JText::_('AUP_EMAILNOTIFICATION_SUBJECT_ACCOUNT_UPDATED');
$body = sprintf(JText::_('AUP_EMAILNOTIFICATION_MSG_REMOVE_POINTS'), $SiteName, abs($assignpoints), $newtotal, JText::_($rule_name));
}
}
$subject = JMailHelper::cleanSubject($subject);
$body = JMailHelper::cleanBody($body);
$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();
}
}
示例14: getAupAvatar
public static function getAupAvatar($userid, $linktoprofil = 0, $width = '', $height = '', $class = '', $otherprofileurl = '')
{
if (!$userid) {
return;
}
if (!defined("_AUP_AVATAR_PATH")) {
// prevent call in administrator backend
$juriroot = str_replace(DS . 'administrator', '', JURI::root());
define('_AUP_AVATAR_PATH', JURI::root() . 'components/com_alphauserpoints/assets/images/avatars/');
} else {
$juriroot = $juriroot = str_replace(DS . 'administrator', '', JURI::root());
}
if (!defined("_AUP_AVATAR_LIVE_PATH")) {
// prevent call in administrator backend
$juribase = str_replace('/administrator', '', JURI::base());
define('_AUP_AVATAR_LIVE_PATH', $juribase . 'components/com_alphauserpoints/assets/images/avatars/');
} else {
$juribase = str_replace('/administrator', '', JURI::base());
}
$startprofil = "";
$endprofil = "";
$setwidth = $width != '' ? ' width="' . $width . '"' : '';
$setheight = $height != '' ? ' height="' . $height . '"' : '';
$setclass = $class != '' ? ' class="' . $class . '"' : '';
$profile = AlphaUserPointsHelper::getUserInfo('', $userid);
$avatar = $profile->avatar != '' ? _AUP_AVATAR_LIVE_PATH . $profile->avatar : _AUP_AVATAR_PATH . 'generic_gravatar_grey.png';
//$avatar = JURI::root() . "components/com_alphauserpoints/assets/phpThumb/phpThumb.php?src=".$avatar."&w=" . $width ."&h=" . $height;
$avatar = '<img src="' . $avatar . '" border="0" alt=""' . $setwidth . $setheight . $setclass . ' />';
$profileitemid = '';
if ($linktoprofil) {
$profileitemid = '&Itemid=' . AlphaUserPointsHelper::getItemidAupProfil();
$profil = $otherprofileurl ? $otherprofileurl : "index.php?option=com_alphauserpoints&view=account&userid=" . $profile->referreid . $profileitemid;
$startprofil = "<a href=\"" . JRoute::_($profil) . "\">";
$endprofil = "</a>";
$avatar = $startprofil . $avatar . $endprofil;
}
return $avatar;
// USAGE
// $avatar = AlphaUserPointsHelper::getAupAvatar($userid, [int $linktoprofil], [int $width], [int $height], [string $class], [string $otherprofileurl]);
// if $linktoprofil set to 1, display avatar with the link to the AUP profil of this user
// Think to call and include this API helper.php in your script
}
示例15: send
//.........这里部分代码省略.........
if (!file_exists($filename)) {
// download stopped - zip file not found
$msg = JText::_('COM_JDOWNLOADS_FILE_NOT_FOUND') . ': ' . basename($zip_file);
$app->redirect(JRoute::_($current_link), $msg, 'notice');
}
}
// download action check (not for uncategorized)
if ($cat_id > 1) {
// If the category has been passed in the data or URL check it.
$allow = $user->authorise('download', 'com_jdownloads.category.' . $cat_id);
if ($file_id && $allow) {
// If the category has been passed in the data or URL check it.
$allow = $user->authorise('download', 'com_jdownloads.download.' . $file_id);
}
} else {
if ($file_id) {
// If the category has been passed in the data or URL check it.
$allow = $user->authorise('download', 'com_jdownloads.download.' . $file_id);
}
}
if (!$allow) {
// download stopped - user has not the right to download it
$msg = JText::_('COM_JDOWNLOADS_DOWNLOAD_NOT_ALLOWED_MSG');
$app->redirect(JRoute::_($current_link), $msg, 'notice');
}
$transfer_speed = (int) $user_rules->transfer_speed_limit_kb;
if ($jlistConfig['use.alphauserpoints']) {
// get AUP user info
$api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
if (file_exists($api_AUP) && !$user->guest) {
require_once $api_AUP;
$aup_exist = true;
// get user profile data from AUP
$profile = AlphaUserPointsHelper::getUserInfo('', $user->id);
// get standard points value from AUP
$db->setQuery("SELECT points FROM #__alpha_userpoints_rules WHERE published = 1 AND plugin_function = 'plgaup_jdownloads_user_download'");
$aup_fix_points = floatval($db->loadResult());
//$aup_fix_points = JDHelper::strToNumber($aup_fix_points);
}
}
// build a array with IDs
$files_arr = explode(',', $files_list);
// get the files data for multi or single download
$query = $db->getQuery(true);
$query->select('a.*');
$query->from('#__jdownloads_files AS a');
// Join on category table.
$query->select('c.title AS category_title, c.id AS category_id, c.cat_dir AS category_cat_dir, c.cat_dir_parent AS category_cat_dir_parent');
$query->join('LEFT', '#__jdownloads_categories AS c on c.id = a.cat_id');
// Join on license table.
$query->select('l.title AS license_title');
$query->join('LEFT', '#__jdownloads_licenses AS l on l.id = a.license');
$query->where('(a.published = ' . $db->Quote('1') . ')');
if ($files_list) {
$query->where('a.file_id IN (' . $files_list . ')');
} else {
$query->where('a.file_id = ' . $db->Quote($file_id));
}
// Filter by access level so when we get not a result this user has not the access to view it
$query->where('a.access IN (' . $groups . ')');
$query->where('c.access IN (' . $groups . ')');
$db->setQuery($query);
$files = $db->loadObjectList();
if (!$files) {
// invalid data or user has not really the access
$msg = JText::_('COM_JDOWNLOADS_DATA_NOT_FOUND');