Implemented Manually Award Trophies

Steve10

Well-known member
So someone suggested I make a fresh thread with this in because the place I was discussing it was in a resolved area so no one would ever view it. So anyway the idea is that on top of the automatic trophies admins can manually award trophies.

The reasoning for this is if your forum runs competitions and the winner gets the trophy to show off and however many points that come with it. It wouldn't need any criteria or anything and would preferably show up immediately on the users trophy page.

Like if you like, say if you don't.

Edit: This additional feature still hasn't arrived but in better news Russ has made some lovely mock ups of what it could look like to illustrate what we want.

trophy1-gif.19687


trophy2-gif.19688
 
Upvote 63
This suggestion has been implemented. Votes are no longer accepted.
I'd also like to add I'd like to see an option to award a user when joining a certain group under criteria. This would be good for those that pay for a subscription and are placed in a group, like donaters or whatever. Or those that that join the site team or moderate.

Also, while I'm at it... perhaps award trophies to user's that reach a post goal within a certain board & child boards. Or whatever...
Definitely like that. I do that now for subscription members.
 
This would actually be very nice. I wanted to implement some trophies but was unable to do it due to it being restricted to post count, likes, etc. I'd also like this to be a permission for moderators to.
 
This would actually be very nice. I wanted to implement some trophies but was unable to do it due to it being restricted to post count, likes, etc. I'd also like this to be a permission for moderators to.

You mean so moderators would be able to award trophies?
 
To make the trophy system more complete this would me a nice feature indeed!

It looks like its not that hard to change..... There already is a class in Trophy.php called

Code:
class XenForo_Model_Trophy extends XenForo_Model

with a function to ad awards (doh) to a user

Code:
/** * Award the specified user with a specific trophy. * * @param array $user * @param string $username * @param array $trophy * @param integer|null $awardDate If null, use current time */ public function awardUserTrophy(array $user, $username, array $trophy, $awardDate = null) {

and its possible to make a trophy without checking any of the requirement options, so that would make it optional (custom)

So all we need is a user manage profile tab in the admin section to add/delete a trophy too/from a users.
This screen has to show all trophies with a check box behind them to add/remove (check/uncheck) the trophy.

That could be a mix of these functions:
- show all trophies and check all trophies a user already owns (order - show owned trophies on top)

Code:
/**
* Gets all trophies, ordered by their points (ascending).
*
* @return array Format: [trophy id] => info
*/
public function getAllTrophies()
{
return $this->fetchAllKeyed('
SELECT *
FROM xf_trophy
ORDER BY trophy_points
', 'trophy_id');
}

/**
* Gets all trophies that the specified user has earned. Ordered by award date descending.
*
* @param integer $userId
*
* @return array Format: [trophy id] => trophy info plus award_date
*/
public function getTrophiesForUserId($userId)
{
return $this->fetchAllKeyed('
SELECT trophy.*,
user_trophy.award_date
FROM xf_user_trophy AS user_trophy
INNER JOIN xf_trophy AS trophy ON (trophy.trophy_id = user_trophy.trophy_id)
WHERE user_trophy.user_id = ?
ORDER BY user_trophy.award_date DESC
', 'trophy_id', $userId);
}

and the code used for creating the user trophy overview
goes something like this (I added the incomplete<form> code):
Code:
<form>
<ol>
<xen:foreach loop="$trophies" value="$trophy">
<li class="primaryContent">
<xen:include template="trophy" />
<input type="checkbox" name="[insert_trophy_id_here]" />
</li>
</xen:foreach>
</ol>
</form>

So.... ideas anyone ?
 
How ironic to run into you here Steve10.

Steve is the guy who introduced me to Xenforo... been one happy dude ever since :)

Manually awarding trophies would be so nice for rewarding users for things done.
 
How ironic to run into you here Steve10.

Steve is the guy who introduced me to Xenforo... been one happy dude ever since :)

Manually awarding trophies would be so nice for rewarding users for things done.

Lol, good to have you as a happy customer, it's a great platform.

However this idea is just one thing that would really help complete the trophies side of the forum (along with the potential to allocate trophy images).
 
Looking forward to this. Instead of awarding it for x posts, likes, days, there would be an option for "awarded only". I'd like to give this to users that win Signature of the week and other competitions.
 
Well Mike said originally it's something he's looking into and I was hoping it would come in one of the minor releases although it seems like there might be a wait. Any chance of a release in 1.1?
 
This would indeed be an awesome feature, very useful for events like art of the month, and a lot of other contests! And since everyone can see trophies earned by another member it will be an incentive for members to win that particular contest. I've liked the post! Hope it gets implemented ^^
 
Top Bottom