Quote:
Originally Posted by Boofo
How many members do you have? And what is the newest member's userid?
Here is the code I use in my forumhome stats hack on myy site and it works like it is supposed to:
PHP Code:
$statscache['activepercent'] = vb_number_format(($numbermembers / $newuserid) * 100, 2 );
Here are the rsults of that code:
|
Currently it's at 1062 members as the problem began when the members went above 1000. That normal code I posted in my first post worked fine up until 1000 members which just strikes me as strange.
The latest UserID is 1064, which just means that we've deleted 2 members since the beginning. To 1062/1064 I'm surprised gives you the correct answer.
Our users are only active if they've posted at least once. To the first line Queries the database getting the number of users with 0 posts. The second line assigns that number to $nonposters. Third line calculates the Active members by subtracting the Non Posters from the Total Members, then finally the last line calculates the Active User Percentage by dividing the Active Users into the Total Member Count. That makes sense, and it's worked, but when it reached 1000 members it screws up. As though it overflows the variable or something. I'm not sure.
But one thing I have done that's worked is sticking in the Member count manually into the calculations. Like instead of $numbermembers I put 1062 and it works fine, but the variable doesn't.