How do I show the Points module totals in forum

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   How do I show the Points module totals in forum
pcnuke
CZ Newbie
pcnuke has been a member for over 19 year's 19 Year Member
usa.gif florida.gif
Occupation: Raving Maniac
Gender: Male
Website:
Status: Offline
Joined: Jun 06, 2005
0.00 posts per day
Posts: 17
Points: 3,848
   
I downloads the "Nuke Points Module", installed it and it work great. I looked for a simple MOD to show points for members in the forum but found none in downloads, so now what I'm trying to do is to show Points: 0 for each member in the forum. I pulled some code from other sources and was trying to replicate the OnlineStatus mod that shows in the forum and got it to showup, except the code i trying below gives the exact same point amount to every member. I guess I havent created a separation for addition members. Could someone correct this code so it can relate to each individual user correctly, thanks...


Code in forum/viewtopic.php file:
==============================================


//User Points Hack for forum
global $bgcolor2, $prefix, $db, $sitename, $admin, $user;

getusrinfo($user);
cookiedecode($user);
$uname = $cookie[1];
if (is_user($user)) {
$numpoints = $db->sql_fetchrow($db->sql_query("SELECT points FROM ".$prefix."_users WHERE username='$uname'"));
$npoints = intval($numpoints['points']);
echo "$npoints";
}

$template->assign_block_vars('postrow', array(
'POSTER_POINTS' => $npoints,

);
}



Code inserted into theme/viewtopic_body.tpl file:
===================================================

Points: {postrow.POSTER_POINTS}


thanks for the help



Back to top Reply with quote
#2   re: How do I show the Points module totals in forum
dkwds
CZ Active Member
dkwds has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student
Age: 38
Gender: Male
Website:
Status: Offline
Joined: Jul 29, 2004
0.04 posts per day
Posts: 282
Points: 12,713
   
[ Register or login to view links on this board. ]




_________________
Back to top Reply with quote
#3   re: How do I show the Points module totals in forum
pcnuke
CZ Newbie
pcnuke has been a member for over 19 year's 19 Year Member
usa.gif florida.gif
Occupation: Raving Maniac
Gender: Male
Website:
Status: Offline
Joined: Jun 06, 2005
0.00 posts per day
Posts: 17
Points: 3,848
   
Ok I see how Telli's fix to displays "Points" works, but thats can only be usered in certain areas where only that 1 specific members points need to show....

Code in forum/viewtopic.php file:
==============================================

$user_points = 'Points: '.$userinfo['points'];

$template->assign_block_vars('postrow', array(
POSTER_POINTS' => $user_points,


&


Code inserted into theme/viewtopic_body.tpl file:
===================================================

Points: {postrow.POSTER_POINTS}




But this will not work correctly in the forum, because it gives everyone the same totaled points as the logged in memer at the time. It does not distinquish between individual members point totals.

So my questions is.. Does anyone know the correct code to distiquish member points for the forum. Telli has it showing fine in this forum.
So I'm looking for that Points code piece to use in the forum "viewtopic.php file"


I've been playing with it and this below works, but again everyone has the same exact point totals with it.

==================================================================================


//User Points Hack for forum
global $bgcolor2, $prefix, $db, $sitename, $admin, $user;



if (is_user($user) AND $cookie[1] == "$username" OR is_admin($admin)) {
$userdata = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_field WHERE need <> '0' ORDER BY pos"));
} else {
$userdata = $db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_field WHERE need <> '0' AND public='1' ORDER BY pos");
}

if ($Version_Num > 6.9) {
if (is_user($user) AND $cookie[1] == "$username" OR is_admin($admin)) {

$user_points = 'Points: '.$userinfo['points'];

}

}



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum