Log in

View Full Version : Display Users Points


Mike Cout
03-28-2004, 12:06 PM
Hello,
I am currently working on a hack and I have been unsuccessful in figuring out how to display each users pointtotal in the postbit.

I have added "points" to the users in the database, I am unable to properly sort the information and send it out to the postbit.

If anyone could help me with this or put me on the right track I would be very grateful.

Thank You,
-mc

Boofo
03-28-2004, 02:07 PM
Is it you can't pull the info it from the db or you are getting a query for each post on the page?

Mike Cout
03-28-2004, 02:11 PM
I don't know how to pull in the info for each individual user. I would like to keep it to one query and pull all the info from that.

I tried looking at how VB displays the postcount but I did not understand it. Would like it to run it like that.

Boofo
03-28-2004, 02:26 PM
Maybe something like this?

$yourcount = $DB_site->query_first("
SELECT points AS points
FROM " . TABLE_PREFIX . "user
WHERE userid='".$post[userid]."'
");
$postpoints = $yourcount['points'];

Mike Cout
03-28-2004, 02:35 PM
Trying to get it to work in functions_showthread. Would that be the wrong place?

Boofo
03-28-2004, 02:40 PM
Instead of running that query, try this instead. Add this to the postbit where you want the points to show up.

$post[points]

Let me know what happens. ;)

Mike Cout
03-28-2004, 02:47 PM
YES! It worked!!

Thank you so much!!!

-mc

Boofo
03-28-2004, 02:53 PM
Ok, for future reference. Anything you add to the user table can be done just like that for the postbit from now on. And assassingod is the one to thank for this. I learned sonmething right along with you this time. ;)

Enjoy! ;)