| Author |
Message |
Leo

Joined: Oct 18, 2007
Posts: 12
|
Posted:
Mon Nov 26, 2007 8:00 pm |
|
Hello everyone,
I am using PHPnuke 7.9 and I currently have the point system setup.but I dont know how do i create a user point status block? so the user know how many points they have left.
Thanks. |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 921
|
Posted:
Mon Nov 26, 2007 10:59 pm |
|
Try putting this into a php file named block-Your_Points.php
| php: |
<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
global $user, $db, $user_prefix;
$uinfo = cookiedecode($user);
$current_user = intval($uinfo[0]);
$result = $db->sql_query("SELECT points FROM ".$prefix."_users WHERE user_id='$current_user'");
list($user_points) = $db->sql_fetchrow($result);
$content = "You have <b>$user_points</b> points!"
?>
|
|
| |
|
|
 |
Leo

Joined: Oct 18, 2007
Posts: 12
|
Posted:
Mon Nov 26, 2007 11:50 pm |
|
Thank you very much...  |
| |
|
|
 |
Leo

Joined: Oct 18, 2007
Posts: 12
|
Posted:
Mon Nov 26, 2007 11:53 pm |
|
Well.. I just put it up... But it didnt show the points. only text only.
Can u help me out please?
Thanks |
| |
|
|
 |
Leo

Joined: Oct 18, 2007
Posts: 12
|
Posted:
Tue Nov 27, 2007 1:36 am |
|
it worked. but u have to add this $prefix,
into this code global $user, $db, $user_prefix;
thank u. |
| |
|
|
 |
|
|