View Full Version : Stop showing post count after it gets to a certain number
oldford
04-04-2005, 02:03 PM
After someone reaches a certain number of posts (say 2000) I'd like to have their post count just be text. For example instead of showing "post: 2303" it would say "post: too many to count" or something like that.
I think it would just be a conditional statement, but I'm not sure how to write it.
Thanks for any help!
oldford
04-25-2005, 05:26 AM
Just a bump after a few weeks.
WetWired
04-25-2005, 02:37 PM
It should be as simple as searching for $post[posts] in the postbit or postbit_legacy template, and replacing it with<if condition="$post[posts]>=2000">Too many<else />$post[posts]</if>
oldford
04-25-2005, 03:47 PM
Excellent! Thanks for the reply.
Do I need to rebuild the post count after making this change? It doesn't seem to be working at the moment.
WetWired
04-25-2005, 08:01 PM
Hmm, it's because of the thousands separator. They applied it to both of the posts variables that I know of, so you may have to remove it from
Language Manager->Edit Settings->Number Formatting->Thousands Separator
Of course, that would remove it everywhere...
Ian Montgomerie
09-12-2005, 11:47 PM
Bumping this thread, because I'm trying to do the same thing, without removing the separator.
I am happy with just displaying "1000 or more" if the user has 1000 or more posts. I figure that you can check for this using strlen($post[posts]) > 3.
Problem is... can I call strlen from a template? It's not allowed within the if conditional itself. Can I call a function somewhere else and have it set a variable? I know PHP but am a bit clueless about how much of it fits into VBulletin templates.
Currently I've hacked a solution as follows:
<if condition="($post[posts]{0}==NULL) || ($post[posts]{1}==NULL) || ($post[posts]{2}==NULL) || ($post[posts]{3}==NULL)">
$vbphrase[posts]: $post[posts]
<else />
$vbphrase[posts]: 1000 or more
</if>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.