Golden 'Visits'-medal

Coen
8 years ago | edited 8 years ago

0

Hi admins,

It seems the medal for visits does not work. I have visited this website every day for the past 36 days, but I still didn’t receive the golden ‘visits’ medal (visit the website each day for a month):

Image

24replies
11voices
310views
1image
SIGKILL [r4v463]
8 years ago

0

It’s weird because I got mine 2 days ago (I’m on a 32 days streak) Can’t help you on this point :x

Coen
8 years ago

0

Weird… I’m currently 38 days and counting

Luke [flabbyrabbit]
8 years ago

0

I’ve manually given you the medal, not sure what happened

DOSmaster
8 years ago

0

Quite odd indeed. Maybe a tiny hickup somewhere? (Or could be a “if a = b” instead of “if a >= b”? Guess not)

Coen
8 years ago

0

Cheers @flabbyrabbit!

tehron
8 years ago

0

If anything, it has to be what @DOSmaster said… >_>

DOSmaster
8 years ago

1

Naaah. <.< Not true, I make mistakes, sometimes, oke a few times, oke a lot. But so does everyone. :P

Mr. Cyph3r [MrCyph3r]
8 years ago

0

Mistakes you say?
I recently spent like 20 minutes testing an app locally, complaining about weird behaviours only to find out that I was testing the online server rather than the local app, I felt soooooo noob :P

PNTSTR
8 years ago

0

Thats what i found on GitHub
hackthis.co.uk/blob/master/files/class.user.php (165)
if ($this->consecutive == 7) { $this->awardMedal('visits'); } else if ($this->consecutive == 14) { $this->awardMedal('visits', 2); } else if ($this->consecutive == 30) { $this->awardMedal('visits', 3); }

Rewrite to
if ($this->consecutive >= 7) { $this->awardMedal('visits'); } else if ($this->consecutive >= 14) { $this->awardMedal('visits', 2); } else if ($this->consecutive >= 30) { $this->awardMedal('visits', 3); }

Or better
if (($this->consecutive >= 7) and (not have "visits 1" medal))) { $this->awardMedal('visits'); } else if (($this->consecutive >= 14) and (not have "visits 2" medal)) { $this->awardMedal('visits', 2); } else if (($this->consecutive >= 30) and (not have "visits 3" medal)) { $this->awardMedal('visits', 3); }

P.S. How to get “Contributor” medal? :)

Luke [flabbyrabbit]
8 years ago

0

Why waste a look up when you know the only day you could possibly award this is on their 30th consecutive visit? Seeing as it has to be consecutive there has to be a 30th visit - it can’t jump from 29 to 31. Obviously something screwed up but I don’t think it is that (I am happy to be proved wrong :p)

DOSmaster
8 years ago

0

@PNTSTR Make a PR that gets accepted. :P

@flabbyrabbit Something must indeed have gone wrong, maybe the server was chasing a bunny and didn’t feel like stopping to check it?
Code seems fine to me to be honest, maybe a “just to be sure”
else if ($this->consecutive >= 30)

PNTSTR
8 years ago | edited 8 years ago

0

I’m still looking for the cause, but noticed that Coen’s 30 day was on New Year day. What if code:
SELECT DATEDIFF(last_active, CURDATE())
return not that that we expect?

And code in class.stats.php (25) shoud rewrite from
if ($res->diff == -1) $consecutive = 1;
to:
if ($res->diff <= -1) $consecutive = 1;

DOSmaster
8 years ago

0

Then we debug it (Echo replies to an overlay) by setting fake dates and run it on a private server. :P

Luke [flabbyrabbit]
8 years ago | edited 8 years ago

0

Seeing as the consecutive login counter continued to function correctly it looks like the DATEDIFF did it’s job - the only paths in that part of the code are to reset the counter to 1 or increment. Good idea though.

DOSmaster
8 years ago

0

Or maybe the database had a derp when running this:
public function awardMedal($label, $colour=1, $uid=null) { if (!$uid) $uid = $this->uid; $st = $this->app->db->prepare('INSERT IGNORE INTO users_medals (`user_id`, `medal_id`) SELECT :uid, medal_id FROM medals WHERE label = :label AND colour_id = :colour'); $result = $st->execute(array(':label' => $label, ':colour' => $colour, ':uid' => $uid)); if ($st->rowCount()) { if ($uid == $this->uid) { // Add to feed $this->app->feed->call($this->username, 'medal', $label, $colour); } else { // Lookup username $st = $this->app->db->prepare('SELECT username FROM users WHERE user_id = :uid'); $st->execute(array(':uid' => $uid)); $result = $st->fetch(); $this->app->feed->call($result->username, 'medal', $label, $colour); } } return (bool) $result; }

PNTSTR
8 years ago

0

```>SELECT DATEDIFF(‘20151231’, ‘20160101’)

-1```
So, thats OK :/

And my previous suggestion to change toif ($res->diff <= -1) is bad idea! All users never reseting their counter :o


1

What about a platinum medal now, login everyday for a year?

Mugi [Mugiwara27]
8 years ago

0

Since gold medal are 150 pts, platinum would be 200 ?
Idea for platinum medals ;
- Login everyday for a year
- Post 2000 message
- Earn 10k score

What you guys think about it ?

dloser
8 years ago

0

Every day for a year? I think I have a name for the medal: “No-Life”

checks own activity Never mind…

2000 messages seems a bit extreme. At the moment there are only two people who have the medal for posting 1000 messages.

Mugi [Mugiwara27]
8 years ago

0

However, that’s a great name for the medals ! :)

And yeah it’s a bit extreme but platinum medals are just for extreme Hackthis’s peoples :)

Coen
8 years ago | edited 8 years ago

0

@Mugiwara27 / @dloser I think you’re right. I would like to bring this to a wider context. The medals (in general: trophies, gamification) are meant to give people incentive for being an active member of the community, solving the challenges etc. I make a guess here, since I was not involved in the creation of this site.

Introducing new medals could be a good idea in general. Of course as soon as new challenges are developed, they could yield new medals; uptil then it may be a good idea to introduce more medals for social aspects of the website. Bringing in a platinum trophy is a cool idea, although not many would reach that level. Thinking of other medals in the medium-range would reach a broader public and may motivate more people to become active participants in the community

Mugi [Mugiwara27]
8 years ago

0

The more points you can get with some special medals, the more peoples in Hackthis are going to be encouraged ( or challenged ) to earn this medal
But yeah, introducing new medium-range medal could be a good idea too

Coen
8 years ago

0

Yes, that’s true. Achievements should never feel ‘too easy’, or you’ll miss the feeling of accomplishment, which is what the medal was for in the first place ;)

cn9 [1337boy]
8 years ago

0

what about some medals you can get when you have

  • unlocked all the bronze medals
  • unlocked all the silver medals
  • unlocked all the gold medals
  • master medal - unlocked all of the above
You must be logged in to reply to this discussion. Login
1 of 25

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss