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

humbleworld

That's very generous of you, JohnWayne. In real practice, I've been donating to charitable organizations in many small ways I can.

Anyhow, our forum of more than half a million posts has just embraced your MOD. All our members just love it.

humbleworld

Hello JohnWayne,

I have a couple of questions: How can I modify the number of medals? One member has six medals already. In the first line, there are 4 medals and the other 2 medals are in the next line. I want to make 3 medals only per line so that the medals won't overflow beyond the avatar size.

Another question is: how can I reduce the sizes of the medals? Here's a sample post with six medals of a member.

JohnWayne999

Quote from: humbleworld on November 14, 2012, 09:20:10 PM
How can I modify the number of medals? One member has six medals already. In the first line, there are 4 medals and the other 2 medals are in the next line. I want to make 3 medals only per line so that the medals won't overflow beyond the avatar size.

Another question is: how can I reduce the sizes of the medals? Here's a sample post with six medals of a member.

Hello Humbleworld

For question 1 what you want is modulus of 3. Whenever $mc is fully divisible by 3, send a new line. See if this does the trick. I actually don't have simplemachine anymore, so just doing this blind :D Hope it works for you.

Try replacing the original code of:

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


with this new section of code


$mc=1;
foreach($medalscore as $ms){
if($message['member']['posts']>=$ms) {

echo '<img src="', $imagesURL, '/medal', $mc++, '.png" alt="" />';

if($mc % 3 == 0) echo '<br>';  // Send a new line everytime count reaches 3 ie. remainder of 0 when divided by 3

} // end of if_message_member_posts_greater_or_equal_to_ms

} // end of ms foreach


If it doesn't work, try changing the 3 to a 2 and see if that helps. I always seem to miscount things by 1.

About question 2, reducing size of icons. Try googling image resizer. There should be some free software or websites out there that shrink things for you. Another more flexible way is to set up HTML tables and scale things in to the rows and columns. I might give that a go when I get really bored.

Good luck.

His_Shadow

Something for future consideration:

Option for making the awarding of the medals manual instead of based on a db value.

joeyjojoshabadoo

Hi guys, im having some big problems with this mod. It is causing a huge amount of server errors.
Despite having uninstalled it the mod is still listed in 'installed packages'. when i try to uninstall it there i get ' unable to find package file'. ( this is because i already uninstalled it)

I thought the problem might be residual mentions of 'medals' and 'medal score' that i can find in the default theme's display.template.php. The error logs were leading back to the default theme aswell. So i went into the default display template and the backup and removed any mention of autoaward ( there was still some there)

Yet, it's still kicking out errors every time someone posts, like this

File does not exist: ********************************** /Themes/default/images/medals referrer : ( URL of a new post)

Can you help me out here guys?

mexinspain

It's been a long time since I returned to SMF  ;)   can someone please let me know where to set this

QuoteSo make sure your forum has display for total number of posts enabled inorder for this mod to work.

Thanks..

CheeseHead05

Hi,

As I am new to SMF, I would like to know how can I make the medals visible, I installed the mod but what's next? where are the medals located?

Thanks in advance!

TheListener

Quote from: CheeseHead05 on May 16, 2013, 12:52:15 AM
Hi,

As I am new to SMF, I would like to know how can I make the medals visible, I installed the mod but what's next? where are the medals located?

Thanks in advance!

As per the other mods post.

If images are shown in the default theme then they will need to be copied over to the theme you are using.

CheeseHead05

Old Fossil,

But the thing is even in default I cant get them to show. What do u mean be copied? So, would I go to my themes/images/post and what's next? copy the files over to my theme?

P.S.

This is my very first time with web developing, im enjoying the learning process but it can become frustrating at times when things dont work or appear as they should.

Thanks!

CheeseHead05

I have an issue on hand,

I recently installed Auto Award using the 2.0.4 forum version but when I go to install GP/BP I get "The package you are trying to download or install is either corrupt or not compatible with this version of SMF.". So I delete the entire forum and re-install. I install GP/BP first using the forum version 2.0.4 and it goes thru so then I attempted to install Auto Award and I get "The package you are trying to download or install is either corrupt or not compatible with this version of SMF." Where is the problem with the two because obviously they are not compatible. And Im using SMF 2.0.4.

TheListener

Read the mod emulate link in my signature.

;)

CheeseHead05

Matter of fact, ever since I installed that GP/BP, none of my other mods are installing. But when I uninstall that mod, then everything installs back again..

CheeseHead05


CheeseHead05

Old Fossil,

Ive read the link, but what do I do when I have a custom theme? Do I go into the index.template.php?

TheListener

With all mods if the mod uses a file which is available on the default theme the the theme you are using will also require the same edit.

CheeseHead05

Old Fossil,

Is there a shortcut so that I dont have to find the lines to replace being that there are 1000 LINES! I mean too many blinks could make me miss the line. There has to be a browser add on. There's is no way that I can go thru all those lines and find it!

CheeseHead05

And that is in reference to the FTP directory.

TheListener

Use Notepad##

Will make life a lot easier  ;)

CheeseHead05

Hi,

I recently reinstall my custom theme, meaning that I removed the AutoAward medals from the default/image folder and moved them into my new custom theme/images/posts folder but when I go to see them in the actual forum, I dont see them. Are there permissions in the Admin panel in reference to AutoAward? What am I doing wrong?

CheeseHead05

I recently switched my theme and my medals are not showing up. The theme's folder shows up in my FTP and I relocated the medals to the image folder as well as post folder under the theme but its not showing up in the post..

Please Help! :-\

Advertisement: