Need little help with php and user points

  • Posts: 1119
  • Thank you received: 114
8 years 9 months ago #227660

Hi,

1. I am trying to display logged in user name with icon. I need to add title on that icon however I cant get it right and my php code get syntax error. Could anyone help me to fix it?

<?php
$user = JFactory::getUser();
$groups = $user->groups;
if($user->id)  {
if (isset($groups[2])) echo '<span class="uservip none"><i class="fa fa-star-o fa-lg" title="<?php echo JText::_( 'MY_CUSTOM_TITLE'); ?>"></i></span>';
if (isset($groups[5])) echo '<span class="uservip bronze"><i class="fa fa-star fa-lg" style="color: #CD7F32;"></i></span>';
if (isset($groups[7])) echo '<span class="uservip silver"><i class="fa fa-star fa-lg" style="color: #c0c0c0;></i></span>';
if (isset($groups[6])) echo '<span class="uservip gold"><i class="fa fa-star fa-lg" style="color: #ffd700;></i></span>';
echo '<span class="usernick userstatus">', $user->username, '<i class=" fa fa-caret-down" style="padding: 3px;"></i></span>';
}
?>

2. Is there a way to display user points with some php code? If yes, what code I can add?

3. I know hikashop 3 is coming soon. When can we expect it? I am waiting for one page checkout....

Regards

Last edit: 8 years 9 months ago by kyratn.

Please Log in or Create an account to join the conversation.

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 9 months ago #227677

Hi,

1. I'm sorry but your request is not related to HikaShop.
I recommend you to use the Joomla forum for that question.

2. It depends which mode you're using for the "user points".
If it is the "alphauserpoints" or the "easysocial points" ; it is related to that components.
If you're using the custom field "user points" ; you'll need to load the HikaShop user object and display the value in the field "user_points".

// Please note that HikaShop core helper should be included.
$hkUser = hikashop_loadUser(true);
echo (int)$hkUser->user_points;

3. We can't tell for the moment.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
8 years 9 months ago #227707

1. I will wait and maybe someone with better php skills will answer my question and i wont need to register to joomla forum because of one easy question.

2. Thanks

3. Thanks

Last edit: 8 years 9 months ago by kyratn.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum