Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Very Simple Automatic Medals Based On Posts
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #15
RE: Very SImple Automatic Medals Based On Posts
(07-22-2011 02:55 PM)ZiNgA BuRgA Wrote:  It doesn't make sense to add a thousands separator to the number of posts.

Now I removed it and it worked:

PHP Code:
<if $post['postnum'] >= $mybb->settings['pn2'] then>

---

(07-22-2011 02:55 PM)ZiNgA BuRgA Wrote:  And are you using 'pn1' or 'pn2' ?  You should be comparing with the number (pn1), not the HTML (pn2).
I'm using both, I just did the complete tutorial and I paste this in my postbit_author_user:

PHP Code:
1
2
3
4
5
6
<if str_replace($mybb->settings['thousandssep'],'',$post['postnum']) >= $mybb->settings['pn1'] then>
	{$mybb->settings['am1']}
</if>
<if str_replace($mybb->settings['thousandssep'],'',$post['postnum']) >= $mybb->settings['pn2'] then>
	{$mybb->settings['am2']}
</if>


But because it didn't worked I then edited like this:

PHP Code:
1
2
3
4
5
6
<if $mybb->settings['thousandssep'] + $post['postnum'] >= $mybb->settings['pn1'] then>
	{$mybb->settings['am1']}
</if>
<if $mybb->settings['thousandssep'] + $post['postnum'] >= $mybb->settings['pn2'] then>
	{$mybb->settings['am2']}
</if>


Or this (what also worked), as you mentioned, it what useless to use a thousands separator:

PHP Code:
1
2
3
4
5
6
<if $post['postnum'] >= $mybb->settings['pn1'] then>
	{$mybb->settings['am1']}
</if>
<if $post['postnum'] >= $mybb->settings['pn2'] then>
	{$mybb->settings['am2']}
</if>

---

(07-22-2011 02:55 PM)ZiNgA BuRgA Wrote:  Can you put the following into your template and post the output generated by it?

HTML Code
<div>Thousands Separator: {$mybb->settings['thousandssep']}</div>
<div>Post Num: {$post['postnum']}</div>
<div>PN1: {$mybb->settings['pn1']}</div>

Code:
Thousands Separator: ,
Post Num: 105
PN1: 1


I also checked PN2:
PN2 = 100


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
07-22-2011 05:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Very SImple Automatic Medals Based On Posts - Sama34 - 07-22-2011 05:17 PM

 Standard Tools
Forum Jump: