PDA

View Full Version : Make post counts have commas


JJR512
11-13-2001, 01:43 PM
How can I make post counts for members have commas if their count is over 1000 (so it looks like 1,000)?

Admin
11-13-2001, 01:53 PM
In functions.php, add this:
$post[posts]=number_format($post[posts]);
-after- this:
$postsperday = sprintf("%.2f",($post[posts] / $jointime));
}
That's all.

I just hope you don't use $post[posts] in other hacks you may have in the getpostbit() function, because doing this will more than likely screw any other hacks using this number up.

JJR512
11-13-2001, 02:20 PM
Building on your modification, to solve any possible conflicts mentioned in your warning, could I just change this:
$post[posts]=number_format($post[posts]);

To this:
$postcomma[posts]=number_format($post[posts]);

And change $post[posts] in the postbit template (and where ever else it appears) to $postcomma[posts]? That way, $post[posts] itself would be unaffected, in case other hacks do use it.

Admin
11-13-2001, 02:26 PM
$post[postscomma]=number_format($post[posts]);
is cleaner IMO. :)