Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Very Simple Automatic Medals Based On Posts
MrBrechreiz Offline
Member
***
Posts: 69
Joined: May 2012
Post: #21
RE: Very SImple Automatic Medals Based On Posts

PHP Code:
<if $mybb->settings['pn1'] >= $post['uid'] then>
	{$mybb->settings['am1']}
</if>


It's that right, for a selected user? I would like to issue the user with the id 1. He should get a certain image.

Thanks

05-06-2012 10:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #22
RE: Very SImple Automatic Medals Based On Posts
Something like this (for user id 1):

Code:
<if $post['uid'] == 1 && $mybb->settings['pn1'] >= $postnum then>{$mybb->settings['am1']}</if>


05-07-2012 07:09 AM
Find all posts by this user Quote this message in a reply
MrBrechreiz Offline
Member
***
Posts: 69
Joined: May 2012
Post: #23
RE: Very SImple Automatic Medals Based On Posts
Thank for your reply. Too bad it's not work for me.
I have tested this code

PHP Code:
<if $post['uid'] == 1 && $mybb->settings['pn1']  then>
       {$mybb->settings['am1']}
</if>


The image is displayed, only I do not know if it works on permanent.

best thanks anywayGreat

05-07-2012 07:36 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Online
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #24
RE: Very SImple Automatic Medals Based On Posts
You probably need to add some condition to $mybb->settings['pn1']


But you say the image displays, which means it works?

My Blog
05-07-2012 02:10 PM
Find all posts by this user Quote this message in a reply
MrBrechreiz Offline
Member
***
Posts: 69
Joined: May 2012
Post: #25
RE: Very SImple Automatic Medals Based On Posts
Yes it works. Thank you for your help.
05-07-2012 09:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #26
RE: Very Simple Automatic Medals Based On Posts
(05-07-2012 07:36 AM)MrBrechreiz Wrote:  Too bad it's not work for me.
Note that the basic idea is, the $mybb->settings['pnX'] value is the min num of posts for a user to get the $mybb->settings['amX'] medal.
So, for example, the $mybb->settings['pn1'] value is the min num of posts for a user to get the $mybb->settings['am1'] medal.
If you set 10 as the value of the $mybb->settings['pn1'], if a user has >= 10 posts, he/she will get the $mybb->settings['am1'] medal.
It means that we need to compare the user posts (in postbit, $postnum for MyBB >= 1.6.5) and the $mybb->settings['pn1'] value.
(05-07-2012 07:36 AM)MrBrechreiz Wrote:  

PHP Code:
<if $post['uid'] == 1 && $mybb->settings['pn1']  then>
       {$mybb->settings['am1']}
</if>

In your code above, there is no comparison. The code above means, if the user's id is 1, and the $mybb->settings['pn1'] has a value (no matter whatever the value is), the user will get the $mybb->settings['am1'] medal (no matter how many posts the user has).
So, I think (only my personal opinion) you don't really need the $mybb->settings['pn1'] there?

I'm sorry if I misunderstand what you want to do.

If you only want to give a specific image for user id 1 unconditionally, you can just use the $post['uid'] there, something like this:

Code:
<if $post['uid'] == 1 then><img src="image_url" alt="" title="" /></if>

You don't need to create any settings for that.

Again, I'm really sorry if I misunderstand what you want.


05-08-2012 06:18 AM
Find all posts by this user Quote this message in a reply
MrBrechreiz Offline
Member
***
Posts: 69
Joined: May 2012
Post: #27
RE: Very Simple Automatic Medals Based On Posts

PHP Code:
<if $post['uid'] == 1 then><img src="image_url" alt="" title="" /></if>


very nice just that I was looking for. please excuse that I have expressed myself so indistinctly. I wanted to give the user with uid1 a permanent medal and the automatic with the medals I understand how it works. thank you very much for your time invested for me.

05-08-2012 04:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pebbles Offline
Junior Member
**
Posts: 1
Joined: Mar 2022
Post: #28
RE: Very Simple Automatic Medals Based On Posts
Hi there,

I have a question.
Is it possible to only count posts from certain forums?

Best wishes
pebbles
03-11-2022 06:28 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: