Hello,

Could someone please give me a quick tip so I can move forward on my project?

I'm simply trying to create a block that shows the point total for user #1 using php.

I want to use this for a counter on my site http://carbonpig.com

I've tried the following code as a starting point:

<?php if ($page): ?>
<div class="points">Earned points :<?php print userpoints_get_current_points($user->uid);?></div>
<?php endif; ?>

Any thoughts or help will be greatly appreciated. In fact, I'll paypal you $10 if you have a solution today for the help. If you're pride is beyond cash, that's cool too. I'm simply stuck and can't get the value to appear in a block for some reason.

Thanks ahead of time!

CarbonPig

Comments

kbahey’s picture

Status: Active » Postponed (maintainer needs more info)

I prefer to have this in a module, but a quick and dirty way is this:

<div class="points">
Earned points: 
<?php
print userpoints_get_current_points(1);
?>
</div>
CarbonPig’s picture

Thank you - You're awesome!

kbahey’s picture

Did it work? If so, please mark the issue as fixed.

duckzland’s picture

if you want to show different point on different user page

Earned points:
print userpoints_get_current_points(arg(1));

for different user at any page

Earned points:
global $user;
print userpoints_get_current_points($user->uid);
berdir’s picture

Status: Postponed (maintainer needs more info) » Fixed

Looks like the question is resolved, closing the issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.