View Full Version : A request for number formatting
SWFans.net
11-26-2002, 03:15 AM
Similar to what we see in vB3. How would one go about applying numer_format to threadcount and replycount on forumhome, and replycount and views in forumdisplay.
It can't be all that tough to do. I played around a little myself and couldn't figure it out, but I'm no PHP guru by any means.
And for those who may not be following my request, what I mean is to have numbers for the Numbers of posts, replies and views that currently appear like this in vB 2.x.x
100000
appear like this
100,000
Xenon
11-26-2002, 06:31 PM
in your index.php you find this line:
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
before it add:
$forum[threadcount]=number_format($forum[threadcount]);
$forum[replycount]=number_format($forum[replycount]);
it would be quite similar in forumdisplay.php for threads ;)
SWFans.net
11-26-2002, 07:15 PM
Thanks for pointing me in the right direction. The code I used was actually // Number format hack
$forum[threadcount]=number_format($forum[threadcount]);
$forum[replycount]=number_format($forum[replycount]);
// end number format hackAnd I put it right where you said to. :)
Xenon
11-26-2002, 07:49 PM
hmm, i've meant the same, just typed wrong ;)
SWFans.net
11-26-2002, 08:55 PM
Thanks again. And for anyone that wants to know how to do post counts and view counts, I just put the code // Number format hack
$thread[replycount]=number_format($thread[replycount]);
$thread[views]=number_format($thread[views]);
// end number format hack
right before where the forumdisplaybit template was executed in forumdisplay.php.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.