Customizing SMF > Modifications and Packages
Auto Award
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
--- End quote ---
You make good requests.
Continuing from the new code supplied to you on 9/4/2012. Try replacing this:
--- Code: ---if($mc>=1) echo '<img src="', $imagesURL, '/medal', $mc, '.png" alt="" />';
--- End code ---
with this
--- Code: ---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
--- End code ---
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.
Liam_michael:
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.
--- End quote ---
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?
--- End quote ---
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).
--- End quote ---
Thanks JohnWayne
Problem is I know nothing about PHP, so don't know the coding.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version