Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4263
Latest: Cekky
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43455
Total Topics: 7557
Most Online Today: 315
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 51
Total: 51

Author Topic: Birthdate Badge  (Read 5580 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: 16524
    • 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: 16524
    • 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: 16524
    • 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: 16524
    • 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: 16524
    • 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
4326 Views
Last post January 28, 2008, 09:15:07 am
by draggar
5 Replies
4368 Views
Last post August 22, 2012, 11:21:06 am
by SMFHacks
0 Replies
2612 Views
Last post June 07, 2012, 12:41:05 pm
by FrizzleFried
0 Replies
2363 Views
Last post June 07, 2012, 01:08:47 pm
by FrizzleFried
1 Replies
3791 Views
Last post June 07, 2012, 05:40:14 pm
by SMFHacks

+- Recent Topics

[Mod]Tenor Posting Animated Gifs by SMFHacks
August 30, 2024, 04:04:26 pm

List of other errors after installing and trying to use by SMFHacks
August 27, 2024, 02:15:52 pm

Subject Error by SMFHacks
August 27, 2024, 02:15:46 pm

Store Not Logging Transactions or Sending Emails for Paid Items, Free Items Work by SMFHacks
August 27, 2024, 05:26:52 am

Don't Know How to Unhide Previously Hidden Items in Latest SMF Store 5.0 by Michael Vail
August 26, 2024, 11:38:33 pm

Undefined array key "session_var" and Undefined array key "session_id" Errors by SMFHacks
August 26, 2024, 11:10:54 pm

SMF Links Error by yamiacaveman
August 22, 2024, 06:21:53 pm

HTTP Error 500 by SMFHacks
August 20, 2024, 12:28:53 pm

Site upgrade to 2.1 by live627
August 18, 2024, 02:47:33 am

Uninstall issue and new licence no email by landyvlad
August 16, 2024, 08:05:48 am

Powered by EzPortal