Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12388
Latest: Rands
New This Month: 5
New This Week: 0
New Today: 0
Stats
Total Posts: 40309
Total Topics: 7100
Most Online Today: 97
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 60
Total: 61

Author Topic: Looking for "Holiday Badges", or something similar  (Read 5458 times)

0 Members and 1 Guest are viewing this topic.

Offline balon

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • TangoWorldWide
Looking for "Holiday Badges", or something similar
« on: October 03, 2015, 03:58:00 pm »
Hello,

My forum has been using the SMF-Awards system for quite some time now, almost 5 months, and we've enjoyed it since our original release to our userbase.

As the Holidays approach, I'd like to be able to implement a "Halloween 2015", "Christmas 2015" badge, etc.

My original idea, go in the database, and give all the users on that day the badge. But if there is an easier way to do this, so I do not need to manually edit it, that would be great.

This will allow me to easier issue badges, like a 2-year anniversary, to only users registered for exactly 2 years on that day, instead of something like the account-birthday, which everyone will "eventually" get.


Thanks!

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • View Profile
Re: Looking for "Holiday Badges", or something similar
« Reply #1 on: October 03, 2015, 06:02:12 pm »
All these things are possible with badge awards

Quote
This will allow me to easier issue badges, like a 2-year anniversary, to only users registered for exactly 2 years on that day, instead of something like the account-birthday, which everyone will "eventually" get.
We have that built in for the first 10 years. Auto anniversary badges that are based on the date of registration


Badge awards has a way to manually assign a badge to a user
Quote
As the Holidays approach, I'd like to be able to implement a "Halloween 2015", "Christmas 2015" badge, etc.
Also it might be possible to do auto badges for  every holiday as well such as Christmas badge awarded on the 25th of december each year


Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline balon

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • TangoWorldWide
Re: Looking for "Holiday Badges", or something similar
« Reply #2 on: October 04, 2015, 04:11:47 pm »
Do you still take custom-badge requests? I saw the thread, if I can get a base-code for Holidays, it'd be easier to duplicate down the line.


I wouldn't need the graphics, just the base code and the action, for X date, any user registered can get the award.

So any users registered on October 31, 2015 (or before) would get the Halloween award.

Making it a limited edition badge.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • View Profile
Re: Looking for "Holiday Badges", or something similar
« Reply #3 on: October 04, 2015, 04:30:20 pm »
Yeah I could do that request.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline balon

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • TangoWorldWide
Re: Looking for "Holiday Badges", or something similar
« Reply #4 on: October 16, 2015, 02:15:14 pm »
Hello, I was very busy with school.

So I am interested in first where I can set October 31, 2015 to give out Halloween 2015 Awards to anyone who logs in on this day.


And I am interested in something where I can say, anyone registered before Jan 1, 2015 would get x Award. Where I could rebadge for that action.


I wouldn't need the designs for either, as my staff can do that.


Could you give me a price here or via PM? Also, once I purchase them, would it be alright if I make a post and share them on these forums, open source. As I have no issue paying for the work, but if I could share these two concepts for others, it'd be pretty cool.


Thanks!

Offline Diego Andrés

  • Newbie
  • *
  • Posts: 39
  • SMF lover
    • View Profile
    • SMF Tricks
Re: Looking for "Holiday Badges", or something similar
« Reply #5 on: October 18, 2015, 11:45:17 am »
I would love to have this and I'll probably add it to my forum when I have time.
But I'm curious, how do you handle a leap year? Or are you just using the specific date?

SMF Tricks - Free & Premium Themes for SMF.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • View Profile
Re: Looking for "Holiday Badges", or something similar
« Reply #6 on: October 18, 2015, 12:30:16 pm »
Code: [Select]
in sources/badgeawards2.php

Find
[code]
$badgeAction = 'anniversary10';
$regTime = time() - 10 * 365 * 24 * 60 * 60;
if ($memberContext[$memberID]['registered_timestamp'] <= $regTime   && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}


Add
Replace yournewbadgeactionhere with the action of your new badge
And change the "October 31, 2015 11:59pm"

Code: [Select]
$badgeAction = 'yournewbadgeactionhere';
$regTime = strtotime("October 31, 2015 11:59pm");
if ($memberContext[$memberID]['registered_timestamp'] <= $regTime   && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}


This code awards any person with that badge previous of the date
« Last Edit: October 21, 2015, 04:03:00 pm by SMFHacks »
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Diego Andrés

  • Newbie
  • *
  • Posts: 39
  • SMF lover
    • View Profile
    • SMF Tricks
Re: Looking for "Holiday Badges", or something similar
« Reply #7 on: October 20, 2015, 08:08:45 pm »
Thanks

SMF Tricks - Free & Premium Themes for SMF.

Offline balon

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • TangoWorldWide
Re: Looking for "Holiday Badges", or something similar
« Reply #8 on: October 21, 2015, 03:55:34 pm »
Thank you for this!

I just want to confirm before adding this, that it should not be <= regTime, as wouldn't we be looking for everything before October 31?


I read further down and found this.


Second... Would you be able to do a holiday-badge sometime this week? (If not, this current one will definitely do!)

So if you log in on the day October 31, 2015, you get a badge?


I'd assume I need to pay for this one, which is completely fine (I will not need the graphics), can you go about telling me how to pay for this, and on completion would you mind just posting it here for other who may wish to have this?


Thanks a ton!
« Last Edit: October 21, 2015, 03:59:12 pm by balon »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • View Profile
Re: Looking for "Holiday Badges", or something similar
« Reply #9 on: October 21, 2015, 04:06:20 pm »
exact date would be

Code: [Select]

   $badgeAction = 'yournewbadgeactionhere';
   $regTimeStart = strtotime("October 31, 2015 12:00am");
   $regTimeEnd = strtotime("October 31, 2015 11:59pm");
   
   if ( ($memberContext[$memberID]['registered_timestamp'] >= $regTimeStart && $memberContext[$memberID]['registered_timestamp'] <= $regTimeEnd)   && !in_array($badgeAction,$currentBadges))
   {
      $badgeID = GetBadgeIDByAction($badgeAction);
         $ret = AddBadgeToMember($memberID,$badgeID,false);
         if ($ret == true)
         {
            $currentBadges[] = $badgeAction;
            $newBadges[]  = $badgeAction;
         }

   }   
   
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline balon

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • TangoWorldWide
Re: Looking for "Holiday Badges", or something similar
« Reply #10 on: October 21, 2015, 04:17:37 pm »
Well awesome, now we have two amazing ones..


But I meant, can you make one that if you log into the website on that day, not just register.

I'd assume we'd use something to trigger the login, similar to what's in invisible, etc, but I'm not completely experienced with PHP.



Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • View Profile
Re: Looking for "Holiday Badges", or something similar
« Reply #11 on: October 22, 2015, 11:15:46 am »
That's a harder would need to be added to checklogin code, cookie.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
6570 Views
Last post September 28, 2007, 11:46:07 am
by smalldonkey
2 Replies
5576 Views
Last post November 06, 2007, 08:55:18 pm
by dry3210
1 Replies
4090 Views
Last post March 26, 2011, 01:26:09 pm
by SMFHacks
8 Replies
5189 Views
Last post September 19, 2011, 02:00:29 pm
by VividViews
21 Replies
9394 Views
Last post September 01, 2012, 02:42:25 pm
by Dylert

+- Recent Topics

Quality of images after import by SMFHacks
September 05, 2020, 10:21:44 am

How do I download gallery images? by CWVRV
August 30, 2020, 11:50:07 pm

Deleting Empty Galleries by SMFHacks
August 30, 2020, 11:43:32 am

PHP error by davejo
August 25, 2020, 07:35:13 am

Permissions to list ads and buy items by CWVRV
August 21, 2020, 05:19:45 pm

Doubt with download permissions. by Rock Lee
August 20, 2020, 08:23:24 pm

Attachment images Upsidedown or Sideways by SMFHacks
August 18, 2020, 05:41:07 pm

[Mod]Avatars Display Integration by Hatshepsut
August 17, 2020, 11:39:54 pm

Simple Portal Block - Classifieds by SMFHacks
August 16, 2020, 09:56:48 am

SMF Links by SMFHacks
August 16, 2020, 08:03:42 am

Powered by EzPortal