The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Stop showing post count after it gets to a certain number
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! |
#2
|
||||
|
||||
Just a bump after a few weeks.
|
#3
|
||||
|
||||
It should be as simple as searching for $post[posts] in the postbit or postbit_legacy template, and replacing it with
Code:
<if condition="$post[posts]>=2000">Too many<else />$post[posts]</if> |
#4
|
||||
|
||||
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. |
#5
|
||||
|
||||
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... |
#6
|
|||
|
|||
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> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|