MyBB Hacks

Full Version: Very Simple Automatic Medals Based On Posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3

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

Something like this (for user id 1):

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

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

You probably need to add some condition to $mybb->settings['pn1']


But you say the image displays, which means it works?
Yes it works. Thank you for your help.
(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.

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.

Hi there,

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

Best wishes
pebbles
Pages: 1 2 3
Reference URL's