Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 template conditional 1000 posts
letsforum Offline
Junior Member
**
Posts: 36
Joined: Sep 2013
Post: #1
template conditional 1000 posts
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?


Internet marketing and SEO forum - http://letsforum.com
(This post was last modified: 08-13-2014 01:12 AM by letsforum.)
08-13-2014 12:46 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: template conditional 1000 posts
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'], ',', '')


My Blog
08-13-2014 12:06 PM
Find all posts by this user Quote this message in a reply
letsforum Offline
Junior Member
**
Posts: 36
Joined: Sep 2013
Post: #3
RE: template conditional 1000 posts
Thanks buddy very much for trying to help.

Internet marketing and SEO forum - http://letsforum.com
08-13-2014 08:20 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: template conditional 1000 posts
If it is for postbit, I think $postnum variable stores the actual number.

08-14-2014 04:00 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #5
RE: template conditional 1000 posts
(08-13-2014 12:06 PM)ZiNgA BuRgA Wrote:  

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


>_> ?

Haha Tongue ...

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
08-14-2014 05:15 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: template conditional 1000 posts
Commas > dots as a delimiter.
Pah!

My Blog
08-15-2014 09:47 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #7
RE: template conditional 1000 posts
I meant the order of the arguments, or am I missing something? I may be too stupid to get it >___>

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 08-17-2014 06:51 AM by Sama34.)
08-17-2014 06:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: template conditional 1000 posts
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).

My Blog
08-17-2014 12:09 PM
Find all posts by this user Quote this message in a reply
letsforum Offline
Junior Member
**
Posts: 36
Joined: Sep 2013
Post: #9
RE: template conditional 1000 posts
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.

Internet marketing and SEO forum - http://letsforum.com
09-12-2014 06:12 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: