Friday, May 24, 2013
   
Text Size

Favourites Email Print

Display user point balance in my component

Author:
Administrator
Date added:
Wednesday, 10 November 2010
Last revised:
Wednesday, 10 November 2010
Hits:
4091
Rating:
 
Vote for this:
Good - Bad
favoured:
0 Favour

Answer

To any component if you like to show avialble balace of current user just copy paste the code below into your php script.

<?php

$dispatcher =& JDispatcher::getInstance();

$sp=$dispatcher->trigger('getProfilePoint', array($user->username));

if($sp[0]==-1)
$sp[0]=0;
echo "<br>".JText::_('PROFILE_BALANCE')."= ".$sp[0]." ".JText::_('PROFILE_POINT');

?>

Above script shows current balance of logged in user $user->username

Replace it '$user->username' with your desired username.

Category

Add comment


Security code
Refresh