News:

Wondering if this will always be free?  See why free is better.

Main Menu

Auto Award

Started by JohnWayne999, December 20, 2011, 01:02:25 PM

Previous topic - Next topic

JohnWayne999

Quote from: pixeleyes on April 09, 2012, 02:23:08 PM
1) Want to add text before Award e.g. "Achievement"
2) Under Award in second line I want that "left posts to next achievement"
e.g.  200 Posts to Next Achievement

You make good requests.

Continuing from the new code supplied to you on 9/4/2012. Try replacing this:

if($mc>=1) echo '<img src="', $imagesURL, '/medal', $mc, '.png" alt="" />';

with this


if($mc>=1){
echo '<br>Achievement<br>';
echo '<img src="', $imagesURL, '/medal', $mc, '.png" alt="" />';
echo '<br>',$ms-$message['member']['posts'],' posts to Next Achievement<br>';
} // endif mc greater or equal to one


Hope that works. My code usually requires serious debugging. So don't be surprised if it doesn't work first go. Good luck.

Just out of curiosity, for people who do not have any medal yet, how would you like the display? Just "Achievement:" then nothing (no medal showing), then "200 posts to Next Achievement"? That kind of looks weird. Currently you need to have at least 1 medal, in order to see the "Achievement:", medal, and "200 posts to Next Achievement". If you'd like something to be displayed for people without any medal ie. total newbies, it should be quite simple also. For example, don't show "Achievement:", and no medal, but just show how many posts to next achievement (to 1st medal). Let me know if you got problems.

Biology Forums

Could they be posted in one's profile?

pixeleyes

Quote from: JohnWayne999 on April 10, 2012, 06:39:05 AM
Just out of curiosity, for people who do not have any medal yet, how would you like the display? Just "Achievement:" then nothing (no medal showing), then "200 posts to Next Achievement"? That kind of looks weird. Currently you need to have at least 1 medal, in order to see the "Achievement:", medal, and "200 posts to Next Achievement". If you'd like something to be displayed for people without any medal ie. total newbies, it should be quite simple also. For example, don't show "Achievement:", and no medal, but just show how many posts to next achievement (to 1st medal). Let me know if you got problems.


So far you codes are working perfet for me :)

Regarding newbie you are absoultely right. So I just made little change in your below code.

First option:
Find:
$mc=1; $printedonce=0;

Repalce with:
$mc=0; $printedonce=0;

Now all text including award will hide from newbie until they reach certain level.

Second option:
Without changing anything just upload an empty award for newbie (only outline) I think that will also look nice.


Before I request for text under award e.g. 200 posts to next achievment.
Now I want more update  :P
I would like that Text (under award) should also change with award.

e.g.
200 posts to Star Award
500 posts to Uniqie Member Award etc.

JohnWayne999

Good on you pixeleyes. I'm glad you found a easy way to solve the problem.
With your latest request, try using another array or a 2 dimensional array. It's not hard, just need to know how to declare and access those elements in the array(s).

Quote from: Liam_michael on April 10, 2012, 05:00:27 PM
Could they be posted in one's profile?

Good suggestion. I would be happy to implement that next time I am free. But to make things easier for me, someone needs to tell me which file to edit. What's the file that handles display of people's profile please? (exact location of the file and file name please).

Have fun guys.

By the way, if anyone has the expertise, see if you can polish up the medals so they display well on grayish and black background. You'll see currently some of the medals still don't have perfect edges on darker themes. I think it's just a matter of using PhotoShop to make individual pixels on the edges transparent, or something like that. That's a be a great help for me and thanks.



pixeleyes

Quote from: JohnWayne999 on April 11, 2012, 07:08:37 AM
Good on you pixeleyes. I'm glad you found a easy way to solve the problem.
With your latest request, try using another array or a 2 dimensional array. It's not hard, just need to know how to declare and access those elements in the array(s).

Thanks JohnWayne
Problem is I know nothing about PHP, so don't know the coding.

pixeleyes

Quote from: JohnWayne999 on April 11, 2012, 07:08:37 AM
Good suggestion. I would be happy to implement that next time I am free. But to make things easier for me, someone needs to tell me which file to edit. What's the file that handles display of people's profile please? (exact location of the file and file name please).

themes/default/profile.template.php

After that code
<dd>', $context['member']['location'], '</dd>';

pixeleyes


Biology Forums

Neat mod, finally got around to it 8)

Take a look at my rendition...

JohnWayne999

Quote from: Liam_michael on April 17, 2012, 11:04:58 PM
Neat mod, finally got around to it 8)

Take a look at my rendition...

Good stuff.

Wanna share the code? I'll include it in the next update and make credit towards you.

Biology Forums

Quote from: JohnWayne999 on April 21, 2012, 09:24:52 AM
Quote from: Liam_michael on April 17, 2012, 11:04:58 PM
Neat mod, finally got around to it 8)

Take a look at my rendition...

Good stuff.

Wanna share the code? I'll include it in the next update and make credit towards you.

Yes, I will, but it's for only individuals with the ultimate profile mod installed... is that okay?

JohnWayne999

Quote from: Liam_michael on April 21, 2012, 12:09:21 PM
Quote from: JohnWayne999 on April 21, 2012, 09:24:52 AM
Quote from: Liam_michael on April 17, 2012, 11:04:58 PM
Neat mod, finally got around to it 8)

Take a look at my rendition...

Good stuff.

Wanna share the code? I'll include it in the next update and make credit towards you.

Yes, I will, but it's for only individuals with the ultimate profile mod installed... is that okay?

Yea that's fine. Thanks for your generosity.
Just quote/paste your part of code (and specify exact location and name of file to edit, and where to insert your code in that file) in this thread if you are okay with it. That way other people can see it early (before I eventually get to add it to next release).
Thanks!

Quote from: pixeleyes on April 11, 2012, 09:13:53 AM
Quote from: JohnWayne999 on April 11, 2012, 07:08:37 AM
Good suggestion. I would be happy to implement that next time I am free. But to make things easier for me, someone needs to tell me which file to edit. What's the file that handles display of people's profile please? (exact location of the file and file name please).

themes/default/profile.template.php

After that code
<dd>', $context['member']['location'], '</dd>';

Thanks pixeleyes for the filename & path.

Your medals look cute. If you want to use them, just cut them up (I think the ideal ratio was 35 x 50 pixels or thereabout) and throw into the medals directory.

dimspace

If anyone has any use for them, heres a set of 39 very tiny images that can be used for a post count bar with above mod.
Basically creates a colour bar running from pink to blue as in the image..

dimspace

Oh and if anybody uses the Thank O Matic  Mod the code for that is as follows

// Start of AutoAward
if (!isset($context['disabled_fields']['posts'])){
$imagesURL = $settings['default_images_url'] . '/medals';
$medalscore = array (30,50,75,100,150,200,250,300,400,500,600,700,800,900,1000,1100);

$mc=1;
foreach($medalscore as $ms){
if($message['member']['thank_you_post']['became']>=$ms)
echo '<img src="', $imagesURL, '/medal', $mc++, '.png" alt="" />';
} // end of ms foreach
} //end isset disabled fields if
// End of AutoAward.


obviously with your own limits. I use the medals system (which is great btw) in conjuntion with the thank you mod so it awards medals based on the number of thanks a poster has recieved.

link to mod http://custom.simplemachines.org/mods/index.php?mod=710

HecticZA

Hi thx for the mod, but need some help please?

When I installed the mod it picked up the posts and awarded the medals as per your initial mod.
I changed the post counts, but it does not reduce the medals that was issued.
My posts at the time of the mod installation was just under 1000 and I was issued 11 medals, but with my changes to medalscore it should show 9, but it still shows 11.
Can you help me pls?

themegenius

Quote from: JohnWayne999 on April 10, 2012, 06:39:05 AM
Quote from: pixeleyes on April 09, 2012, 02:23:08 PM
1) Want to add text before Award e.g. "Achievement"
2) Under Award in second line I want that "left posts to next achievement"
e.g.  200 Posts to Next Achievement

You make good requests.

Continuing from the new code supplied to you on 9/4/2012. Try replacing this:

if($mc>=1) echo '<img src="', $imagesURL, '/medal', $mc, '.png" alt="" />';

with this


if($mc>=1){
echo '<br>Achievement<br>';
echo '<img src="', $imagesURL, '/medal', $mc, '.png" alt="" />';
echo '<br>',$ms-$message['member']['posts'],' posts to Next Achievement<br>';
} // endif mc greater or equal to one


Hope that works. My code usually requires serious debugging. So don't be surprised if it doesn't work first go. Good luck.

Just out of curiosity, for people who do not have any medal yet, how would you like the display? Just "Achievement:" then nothing (no medal showing), then "200 posts to Next Achievement"? That kind of looks weird. Currently you need to have at least 1 medal, in order to see the "Achievement:", medal, and "200 posts to Next Achievement". If you'd like something to be displayed for people without any medal ie. total newbies, it should be quite simple also. For example, don't show "Achievement:", and no medal, but just show how many posts to next achievement (to 1st medal). Let me know if you got problems.

hi i cant find this code

if($mc>=1) echo '<img src="', $imagesURL, '/medal', $mc, '.png" alt="" />'; any were in my display template as i would like to have the achievement text show up.

TrickyRicky

Fantastic mod thanks ever so much

T3CHN0

Nice mod, Cheers

I cropped and downsized the images by 50% so they don't take up allot of space
anyone wanting them can download them, just replace the ones you have with these ones

humbleworld

where can i access the admin area for this MOD?

thank you so so much for creating this MOD. thank you.

humbleworld

to the MOD creator, i'd like to donate you a very small amount as my token of appreciation. what is your paypal address? if in win the lotto, il donate you more. i bet on the lotto everyday.

JohnWayne999

Quote from: humbleworld on October 29, 2012, 12:28:43 AM
where can i access the admin area for this MOD?

thank you so so much for creating this MOD. thank you.

Hey Humbleworld thanks for the offer. That's very nice of you.

This is a free MOD for anyone to use. Many people have also contributed along this thread to its improvement.

Just sit back and enjoy the code, there's no need to donate to me. Alternatively please select any charity or beggar on the street of your choice and donate any amount to them will make me equally happy.

Thanks again.

Advertisement: