News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Auto Award

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

Previous topic - Next topic

Mortuum

Hello, i would like to auto award according the member groupe (ex : Author, Bloggeur etc).
I already try some modification with [membrergroups][id] and change numbrer of post by id number. But it didnt succeed, i actually didnt know what to change for what.
So do you know who to do it please ?

JohnWayne999

Hi guys,

Sorry I am busy with other things at work. Won't have time to answer every post.

Just wish to clarify one thing though: are most people running SMF 2.0.4 finding this mod (Autoaward) ok? I see some posts saying the mod scr3wed up their 2.0.4 system. Just wish to verify this is a recurrent issue on other people also running 2.0.4 and not just on one or two individuals. Thanks. For now I have taken 2.0.4 off the compatible list.

Regarding suggestion for manually awarding medals, I think there already is a mod out there doing this. You can award trophies or something like that.

Motuum, I think you are on the right track. Just need to find the variable responsible, make sure its value is communicated across eg. make sure it's not some local variable or if so, figure out a way to transport it across. See if that helps. Good luck.

JohnWayne999

Hi guys,

Here's a response I gave to someone explaining how to install the mod manually. See if it helps anyone else also:

I haven't used SMF for a couple of years now. Assuming the basic underlying structure hasn't changed, give this approach a go. You install it manually .

There are 3 steps: step 0, step 1, and step 2:

Step 0:


Backup everything .


Step 1:


Find a directory (folder) called

/Themes/default

Inside that directory there should be a file called

Display.template.php

Open that file.

Look for a line that looks like:

<![CDATA[// Is karma display enabled?]]>

Once you found that line (the line shown above), add after it the following:

<![CDATA[


// Start of AutoAward
if (!isset($context['disabled_fields']['posts'])){
$imagesURL = $settings['default_images_url'] . '/medals';
$medalscore = array (10,20,30,40,50,100,150,200,300,400,600,800,1000,1300,1600,2000);

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


]]>




STEP 2:


That's part 1 done. Now Part 2:  you need to copy the medals onto the server. As follows:

Find the folder /Themes/default again.
Inside /Themes/default folder you should see a folder called images. If not, make it yourself.

Next, go into the images folder. Make another folder inside it. Call the folder medals.

Copy all the picture files into that folder.


You are done. If everything works the way they are supposed to, you should see the mod up and running.




rumblecloud

Hi JohnWayne999  ;D

I have your mod up and running on 2.0.6. The members like it. So do I.

But like everyone else, I want to change it  :laugh:

So a question forms:
You mention in your instructions that the awards can be based other than post count, but be sure what you want that to be. "just replace the variable $message['member']['posts'] with whatever variable you have in mind, as long as you know what those exact variables are. "

I want to give out small badges based it on request or just because I want to give one out. So I am assuming I would replace ['posts'] with a variable. Would it be as simple as making it say ['requests'] or what?

Thanks for the great mod.

r


JohnWayne999

Quote from: rumblecloud on November 01, 2013, 04:56:17 PM
Hi JohnWayne999  ;D

I have your mod up and running on 2.0.6. The members like it. So do I.
But like everyone else, I want to change it  :laugh:

So a question forms:
You mention in your instructions that the awards can be based other than post count, but be sure what you want that to be. "just replace the variable $message['member']['posts'] with whatever variable you have in mind, as long as you know what those exact variables are. "

I want to give out small badges based it on request or just because I want to give one out. So I am assuming I would replace ['posts'] with a variable. Would it be as simple as making it say ['requests'] or what?

Thanks for the great mod.

r

Hey there, thanks for the feedback. I'm glad it worked on 2.0.6. If anyone finds it working on simplemachine 1.x please let me know also.

I get what you are asking. You want to assign medals as you like, based on just anyone who asks and that you approve. In simplemachine there is no innate variable for that. You'd need to construct some sort of table file to store which member has been manually assigned what medal. It's a bit too complicated for me for the time being.

Good news is someone actually has already made a mod to do what you want. Just look around in the mods repository, you can award trophies or something as you please. Maybe it's this one:
http://custom.simplemachines.org/mods/index.php?mod=313
Have a look see if it fulfills your desire :D

kingkingston


tjbalon

I was wondering if anyone has made this for member groups yet? I know what variable to add, but a bit confused on how I would go about editing the whole system if I wanted to declare certain awards per certain member group.

TheListener

Quote from: JohnWayne999 on November 20, 2013, 10:03:16 AM
Quote from: rumblecloud on November 01, 2013, 04:56:17 PM
Hi JohnWayne999  ;D

I have your mod up and running on 2.0.6. The members like it. So do I.
But like everyone else, I want to change it  :laugh:

So a question forms:
You mention in your instructions that the awards can be based other than post count, but be sure what you want that to be. "just replace the variable $message['member']['posts'] with whatever variable you have in mind, as long as you know what those exact variables are. "

I want to give out small badges based it on request or just because I want to give one out. So I am assuming I would replace ['posts'] with a variable. Would it be as simple as making it say ['requests'] or what?

Thanks for the great mod.

r

Hey there, thanks for the feedback. I'm glad it worked on 2.0.6. If anyone finds it working on simplemachine 1.x please let me know also.

I get what you are asking. You want to assign medals as you like, based on just anyone who asks and that you approve. In simplemachine there is no innate variable for that. You'd need to construct some sort of table file to store which member has been manually assigned what medal. It's a bit too complicated for me for the time being.

Good news is someone actually has already made a mod to do what you want. Just look around in the mods repository, you can award trophies or something as you please. Maybe it's this one:
http://custom.simplemachines.org/mods/index.php?mod=313
Have a look see if it fulfills your desire :D

Johnwayne the link you gave is NOT for 2.0.x series it is for 1.1.x

PuckinNutz

I want to be able to assign members awards based on succes they had in a game. We run a NHL league for xbox and I want to be able to setup trophies at the end of each season, like most goals in a season to an individual , or allstar , a trophie for winning the stanley cup and so on. Any ideas?

vladok

Somebody solved problem with addition "title=someting" from array to awards?

meemzo

I would like to know if it's possible to hide awards on admins and moderators.  Also is it possible to link awards to "likes" instead of posts.

Worldwide7477

Hey JohnWayne999,

I love that i have found you, i was on a forum that is running this mod and thought it was there making lol and was about to ask for the medals, but long and behold i just added 2.09 to my sight and was browsing around the sight for some extras and here you are with what i'm looking for  ;)

I am a very new newbie to all of this so if you can point me in the right direction or any other member can let me know how to install this that would be great, i'm no newbie to coding but newbie to smf in the installs but it coming along.

Thank you once again for I think one of the best mods out there

"I Like It Allot" in my forest gump voice

Dragon41673

I tried searching, but could not find the needed answer.

Is there a way to make the medals display after the post count? Currently (image attached), my avatar is under almost everything else...but the medals are near the top.

What I'd like to do is swap where the medals & avatar are at. Any help would be appreciated. I'm still learning all this, so I will apologize in advance if the solution is simple!

Thank you!
Owner - Aries Games & Miniatures

Dragon41673

Can anyone help with this?
Owner - Aries Games & Miniatures

Gluz

For that you can edit /Themes/yourtheme/Display.template.php

Then search for the sections of the Poster and move to wherever you want, or if you explain where you want each thing in detail and attach that file I can do the edits for you.

Dragon41673

Awesome...thanks for the direction. That helped me fix a couple issues at the same time that I haven't posted about yet! Very much appreciated!
Owner - Aries Games & Miniatures

Dragon41673

I just hit 1,000 posts, and my awards disappeared. I do have the count of 1000 listed I. The proper file, but they aren't showing. Any thoughts?

EDIT - I think I just found the issue...here's what is listed in my display.template.php file...


// Start of AutoAward
if (!isset($context['disabled_fields']['posts'])){
$imagesURL = $settings['default_images_url'] . '/medals';
$medalscore = array (10,20,30,40,50,100,150,200,300,400,600,800,1000,1300,1600,2000);

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


Shouldn't the listing for where it pulls the images point to the default theme folder? I ask because I'm not using the default template, I'm personally using a different one, yet all medals until I hit 1000 were showing properly & increased while I posted more.
Owner - Aries Games & Miniatures

Dragon41673

JohnWayne999...can you please help out with my issue above? I'm still waiting for a response.

Thanks!
Owner - Aries Games & Miniatures

Dragon41673

Ok, can anyone help with this? I've checked on all installed Theme's and my personal awards do not show up now that I've hit 1000+ posts. I checked & 1000 is listed in the display template for the awards...but they aren't showing. No one else is having this issue...but I'm the only one past 1000 at this time.

Thanks
Owner - Aries Games & Miniatures

JohnWayne999

Hey Dragon4 (and everybody else infact), my profuse apologies for not replying.
I've just been incredibly busy all these years and only more so these coming 2 years.

Dragon4 I had a quick look back at the code and can't understand why past 1000 won't work.
Sorry man I got a couple of pretty damn important exams to study for and don't have spare time to dig into this problem right now.

How about post your problem up https://www.elance.com/
Pay someone $10 to solve your issue. Some people will try to flog hundreds of dollars off you, especially programming companies, just decline those. Generally programmers from India or Asia or latin America are cheaper. You shouldn't need to spend more than $10 tops to have this issue solved.
Make sure ask them to explain to you what was the problem, and how they overcome it. So you don't need to re-ask them again when similar problem comes up. Tell them you want to test run the code yourself before you will pay, or some people take your payment and run.

Good luck. And tell us what the problem is if you find out please.

Advertisement: