Customizing SMF > Modifications and Packages
Auto Award
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...
--- End quote ---
Good stuff.
Wanna share the code? I'll include it in the next update and make credit towards you.
--- End quote ---
Yes, I will, but it's for only individuals with the ultimate profile mod installed... is that okay?
--- End quote ---
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).
--- End quote ---
themes/default/profile.template.php
After that code
--- Code: ---<dd>', $context['member']['location'], '</dd>';
--- End code ---
--- End quote ---
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
--- Code: --- // 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.
--- End code ---
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
--- 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.
--- End quote ---
hi i cant find this code
--- Code: ---if($mc>=1) echo '<img src="', $imagesURL, '/medal', $mc, '.png" alt="" />';
--- End code ---
any were in my display template as i would like to have the achievement text show up.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version