MyBB Hacks

Full Version: template conditional 1000 posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi how can I fix this issue with template conditional. Whenever user has more than 1000 posts it stops working and conditionals like these don't work:

PHP Code:
<div><if $post['postnum'] <= 10 then>Hello</if></div>

PHP Code:
<div><if $post['postnum'] >= 10 then>Hello</if></div>

PHP Code:
<div><if $post['postnum'] == 10 then>Hello</if></div>


However putting {$post['postnum']} shows correct post count!

The problem is in the comma my_number_format 1,000 is not read but the plugin how to fix it?

You need the actual number, not a bit of text.  "1,000" is not actually a number, "1000" is.
If you can't get the actual number, stripping out the commas may work, but no ideal.

PHP Code:
str_replace($post['postnum'], ',', '')

Thanks buddy very much for trying to help.
If it is for postbit, I think $postnum variable stores the actual number.
(08-13-2014 12:06 PM)ZiNgA BuRgA Wrote: [ -> ]

PHP Code:
str_replace($post['postnum'], ',', '')


>_> ?

Haha Tongue ...
Commas > dots as a delimiter.
Pah!
I meant the order of the arguments, or am I missing something? I may be too stupid to get it >___>
Oh I see.
Can't remember the order of the arguments; PHP does things different to other languages (and PHP's strtr has a different order).
Thanks guys I had to create a plugin and hook it to profile and postbit and then use str_replace($post['postnum'], ',', '') to create new value without comma.
Reference URL's