- Posts: 41
- Thank you received: 0
Kunena 7.0.4 Released
The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
Question displaying aupoints in kunena login module
13 years 10 months ago #125762
by michalis
displaying aupoints in kunena login module was created by michalis
kunena login module is awesome
displays avatar
link to pms, profile etc
I would to add the points total of users there to, my php is horrible though, anyone care to help me out?
displays avatar
link to pms, profile etc
I would to add the points total of users there to, my php is horrible though, anyone care to help me out?
Please Log in or Create an account to join the conversation.
13 years 10 months ago #125858
by Matias
Replied by Matias on topic displaying aupoints in kunena login module
We are already doing it somewhere, just need to find the code.. It's probably either in profile template or view.
The following user(s) said Thank You: michalis
Please Log in or Create an account to join the conversation.
13 years 10 months ago #126022
by michalis
Replied by michalis on topic displaying aupoints in kunena login module
thank you, I was trying to find it but couldnt
Please Log in or Create an account to join the conversation.
13 years 10 months ago #126312
by michalis
Replied by michalis on topic displaying aupoints in kunena login module
is it this code that I have to put?
class KunenaProfileAlphaUserPoints extends KunenaProfile {
public function __construct() {
$aup = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
if (! file_exists ( $aup ))
return;
require_once ($aup);
$this->priority = 60;
}
public function getUserListURL($action = '', $xhtml = true) {
$kunena_config = KunenaFactory::getConfig ();
$my = JFactory::getUser();
if ( $kunena_config->userlist_allowed == 1 && $my->id == 0 ) return false;
if (class_exists('AlphaUserPointsHelper') && method_exists ( 'AlphaUserPointsHelper', 'getAupUsersURL' ))
return AlphaUserPointsHelper::getAupUsersURL ();
else {
// For AUP 1.5.3 etc..
static $AUP_itemid = false;
if ($AUP_itemid === false) {
$db = JFactory::getDBO ();
$query = "SELECT id FROM #__menu WHERE `link`='index.php?option=com_alphauserpoints&view=users' AND `type`='component' AND `published`='1'";
$db->setQuery ( $query );
$AUP_itemid = intval ( $db->loadResult () );
}
return JRoute::_ ( 'index.php?option=com_alphauserpoints&view=users&Itemid=' . $AUP_itemid, $xhtml );
}
}
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 (class_exists('AlphaUserPointsHelper') && 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 );
}
public function getProfileView($PopUserCount = 0) {
$_db = &JFactory::getDBO ();
$_config = KunenaFactory::getConfig ();
$queryName = $_config->username ? "username" : "name";
if (! $PopUserCount)
$PopUserCount = $_config->popusercount;
$query = "SELECT a.profileviews AS hits, u.id AS user_id, u.{$queryName} AS user FROM #__alpha_userpoints AS a
INNER JOIN #__users AS u ON u.id = a.userid
WHERE a.profileviews>'0' ORDER BY a.profileviews DESC";
$_db->setQuery ( $query, 0, $PopUserCount );
$topAUPProfileView = $_db->loadObjectList ();
KunenaError::checkDatabaseError ();
return $topAUPProfileView;
}
public function showProfile($userid, &$msg_params) {
}
}
class KunenaProfileAlphaUserPoints extends KunenaProfile {
public function __construct() {
$aup = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
if (! file_exists ( $aup ))
return;
require_once ($aup);
$this->priority = 60;
}
public function getUserListURL($action = '', $xhtml = true) {
$kunena_config = KunenaFactory::getConfig ();
$my = JFactory::getUser();
if ( $kunena_config->userlist_allowed == 1 && $my->id == 0 ) return false;
if (class_exists('AlphaUserPointsHelper') && method_exists ( 'AlphaUserPointsHelper', 'getAupUsersURL' ))
return AlphaUserPointsHelper::getAupUsersURL ();
else {
// For AUP 1.5.3 etc..
static $AUP_itemid = false;
if ($AUP_itemid === false) {
$db = JFactory::getDBO ();
$query = "SELECT id FROM #__menu WHERE `link`='index.php?option=com_alphauserpoints&view=users' AND `type`='component' AND `published`='1'";
$db->setQuery ( $query );
$AUP_itemid = intval ( $db->loadResult () );
}
return JRoute::_ ( 'index.php?option=com_alphauserpoints&view=users&Itemid=' . $AUP_itemid, $xhtml );
}
}
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 (class_exists('AlphaUserPointsHelper') && 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 );
}
public function getProfileView($PopUserCount = 0) {
$_db = &JFactory::getDBO ();
$_config = KunenaFactory::getConfig ();
$queryName = $_config->username ? "username" : "name";
if (! $PopUserCount)
$PopUserCount = $_config->popusercount;
$query = "SELECT a.profileviews AS hits, u.id AS user_id, u.{$queryName} AS user FROM #__alpha_userpoints AS a
INNER JOIN #__users AS u ON u.id = a.userid
WHERE a.profileviews>'0' ORDER BY a.profileviews DESC";
$_db->setQuery ( $query, 0, $PopUserCount );
$topAUPProfileView = $_db->loadObjectList ();
KunenaError::checkDatabaseError ();
return $topAUPProfileView;
}
public function showProfile($userid, &$msg_params) {
}
}
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #126327
by Matias
Replied by Matias on topic displaying aupoints in kunena login module
No, you just need to call this and echo the output:
IMHO it returns NULL if integration isn't enabled.
Code:
$points = KunenaFactory::getActivityIntegration()->getUserPoints($this->profile->userid);
IMHO it returns NULL if integration isn't enabled.
Last edit: 13 years 10 months ago by Matias.
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #126423
by michalis
Replied by michalis on topic displaying aupoints in kunena login module
I would like to apologize for taking up your time with my questions and thank your for putting up with me
I am a novice web designer and I am doing my homework but obviously I am still a novice so I will have to ask one more question
you are right I added it and it did nothing, it needs to be intergrated, I have been trying for hours but nothing, what I did was take the code from the alphauserpoints module and add it to kunena module but still nothing, can you recognize my mistake?
in class.php I added
in mod_kunenalogin.php I added
and in horizontal.php I added
but I still get nothing
I just realized this is a question I might need to post in aup forums so I'll head over there
I am a novice web designer and I am doing my homework but obviously I am still a novice so I will have to ask one more question
you are right I added it and it did nothing, it needs to be intergrated, I have been trying for hours but nothing, what I did was take the code from the alphauserpoints module and add it to kunena module but still nothing, can you recognize my mistake?
in class.php I added
Code:
function getPoints(&$param)
{
$db =& JFactory::getDBO();
$points = 0;
$user =& JFactory::getUser();
$userid = $user->id;
if ( $userid )
{
$query = "SELECT points"
. " FROM #__alpha_userpoints"
. " WHERE userid='".$userid."'"
;
$db->setQuery($query, 0, $count);
$points = $db->loadResult();
}
return $points;
}
in mod_kunenalogin.php I added
Code:
$points = ModKunenaLogin::getPoints($param);
and in horizontal.php I added
Code:
<?php
if ( $points )
{
$f = $param->get('format', 'h1');
echo "<p>".JText::_('AUP_MYPOINTS')."</p>";
echo "<h".$f.">".$points."</h".$f.">";
}
?>
but I still get nothing
I just realized this is a question I might need to post in aup forums so I'll head over there
Last edit: 13 years 10 months ago by michalis.
Please Log in or Create an account to join the conversation.
Time to create page: 0.234 seconds