Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4239
Latest: 3dickulus
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43126
Total Topics: 7500
Most Online Today: 52
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 45
Total: 45

Author Topic: Birthdate Badge  (Read 4557 times)

0 Members and 1 Guest are viewing this topic.

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Birthdate Badge
« on: June 03, 2012, 05:53:14 pm »
I tried this:

Quote
// Birthday
   
   $badgeAction = 'bday';
   if ($memberContext[$memberID]['birth_date'] != '' && !in_array($badgeAction,$currentBadges))
   {
      $badgeID = GetBadgeIDByAction($badgeAction);
         $ret = AddBadgeToMember($memberID,$badgeID,false);
         if ($ret == true)
         {
            $currentBadges[] = $badgeAction;
            $newBadges[]  = $badgeAction;
         }

   }

So that a person gets an award if their birthdate is filled in...

But it's not working, what am I doing wrong?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16378
    • View Profile
Re: Birthdate Badge
« Reply #1 on: June 03, 2012, 05:57:43 pm »
That looks right as long as the custom badge action is called bday

And you added it to the Badges_CheckMember function
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 shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Birthdate Badge
« Reply #2 on: June 03, 2012, 06:58:03 pm »
That looks right as long as the custom badge action is called bday

And you added it to the Badges_CheckMember function

Could you tell me what I'm doing wrong? Could you try it and see if it's working for you?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16378
    • View Profile
Re: Birthdate Badge
« Reply #3 on: June 03, 2012, 07:00:37 pm »
Also remember if it is there that badgecheckmember function it is only checked when checkmember function is called so you probably need to rebadge members.

The file looks like fine.
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 shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Birthdate Badge
« Reply #4 on: June 03, 2012, 07:05:16 pm »
Also remember if it is there that badgecheckmember function it is only checked when checkmember function is called so you probably need to rebadge members.

The file looks like fine.

So, if a new member adds a birthdate, it won't register automatically?

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Birthdate Badge
« Reply #5 on: June 03, 2012, 07:10:53 pm »
Update, I clicked "Rebadge Members"

And everyone seemed to get this new badge... I think it's because SMF automatically registers people as 0000 00 00 as their birthday.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16378
    • View Profile
Re: Birthdate Badge
« Reply #6 on: June 03, 2012, 07:13:10 pm »
Not at the moment. You would need to call checkmember function after a profile has been modified.

The ones that are auto checked after completed are level, posting awards, user agents,mobile,spammer awards,combination,karma awards,search
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 shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Birthdate Badge
« Reply #7 on: June 03, 2012, 07:15:26 pm »
Not at the moment. You would need to call checkmember function after a profile has been modified.

So how do I make it automatic? Is it something I add to profile.php?

Also, webmaster badge doesn't work...
« Last Edit: June 03, 2012, 07:20:39 pm by shuban »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16378
    • View Profile
Re: Birthdate Badge
« Reply #8 on: June 03, 2012, 07:20:56 pm »
Yes there are couple badges that do not work they were still pending development when I updated the release for you. Mainly the last 5 new badges.

You would need to add a code to Profile.php
Code below checks the checkmember function you must set and pass a $memberID to that function
Code: [Select]
global $sourcedir, $modSettings;

if (!empty($modSettings['badgeawards_enable']))
{


require_once($sourcedir . '/badgeawards.php');
Badges_CheckMember($memberID);

}
Or this code to give a specific badge

Code: [Select]
// Badge Awards
global $sourcedir, $ID_MEMBER, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

require_once($sourcedir . '/badgeawards.php');
Badges_AwardBadge($ID_MEMBER,'search');
}
// End Badge Awards
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 shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Birthdate Badge
« Reply #9 on: June 03, 2012, 07:43:00 pm »
I tried the first one, but like I said, SMF has 0000 00 00 for people who don't fill it in, so it automatically makes it think that a birthdate is filled in, allowing everyone to have it.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16378
    • View Profile
Re: Birthdate Badge
« Reply #10 on: June 03, 2012, 07:53:10 pm »
Looks like this is the default
birthdate date NOT NULL default '0001-01-01',
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
3598 Views
Last post January 28, 2008, 09:15:07 am
by draggar
5 Replies
3577 Views
Last post August 22, 2012, 11:21:06 am
by SMFHacks
0 Replies
1615 Views
Last post June 07, 2012, 12:41:05 pm
by FrizzleFried
0 Replies
1567 Views
Last post June 07, 2012, 01:08:47 pm
by FrizzleFried
1 Replies
2607 Views
Last post June 07, 2012, 05:40:14 pm
by SMFHacks

+- Recent Topics

“Insert from Gallery” by apothocary
November 21, 2023, 07:25:28 am

SMFHacks Black Friday Sale 2023! by SMFHacks
November 19, 2023, 12:05:51 pm

File Count by SMFHacks
November 11, 2023, 11:46:46 am

Theme Changer by SMFHacks
November 09, 2023, 04:30:05 pm

Pretty Urls extras by SMFHacks
November 08, 2023, 05:23:14 pm

Member group access to emojis by SMFHacks
October 22, 2023, 07:24:12 am

Miscellaneous errors - don't know why by SMFHacks
October 13, 2023, 09:28:50 am

Follow / Follower Mod? by Nicole
October 06, 2023, 07:37:20 am

Mods supporting custom themes? by SMFHacks
October 02, 2023, 04:20:18 pm

Version 6.1.6 issues by SMFHacks
September 30, 2023, 07:54:52 am

Powered by EzPortal