Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 182
Total: 183

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

0 Members and 1 Guest are viewing this topic.

Offline balon

  • Member
  • *
  • 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: 16436
    • 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

  • Member
  • *
  • 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: 16436
    • 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

  • Member
  • *
  • 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

  • Member
  • *
  • Posts: 39
    • 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: 16436
    • 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

  • Member
  • *
  • Posts: 39
    • 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

  • Member
  • *
  • 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: 16436
    • 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

  • Member
  • *
  • 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: 16436
    • 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
8877 Views
Last post September 28, 2007, 11:46:07 am
by smalldonkey
2 Replies
8178 Views
Last post November 06, 2007, 08:55:18 pm
by dry3210
1 Replies
6571 Views
Last post March 26, 2011, 01:26:09 pm
by SMFHacks
8 Replies
8282 Views
Last post September 19, 2011, 02:00:29 pm
by VividViews
21 Replies
12501 Views
Last post September 01, 2012, 02:42:25 pm
by Dylert

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal