Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4229
Latest: Ghost
New This Month: 3
New This Week: 0
New Today: 0
Stats
Total Posts: 43074
Total Topics: 7493
Most Online Today: 108
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 41
Total: 41

Author Topic: Birthdate Badge  (Read 4468 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: 16353
    • 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: 16353
    • 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: 16353
    • 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: 16353
    • 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: 16353
    • 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
3567 Views
Last post January 28, 2008, 09:15:07 am
by draggar
5 Replies
3526 Views
Last post August 22, 2012, 11:21:06 am
by SMFHacks
0 Replies
1592 Views
Last post June 07, 2012, 12:41:05 pm
by FrizzleFried
0 Replies
1543 Views
Last post June 07, 2012, 01:08:47 pm
by FrizzleFried
1 Replies
2543 Views
Last post June 07, 2012, 05:40:14 pm
by SMFHacks

+- Recent Topics

Version 6.1.6 issues by davejo
Today at 02:21:44 pm

Follow / Follower Mod? by SMFHacks
September 23, 2023, 08:44:44 am

Looking for a good video player by replayuk
September 23, 2023, 12:17:39 am

[Mod]Discord Web Hooks by SMFHacks
September 22, 2023, 03:57:28 pm

SMF 2.1.4 Search by Anmer
September 22, 2023, 01:55:15 pm

Error in thise mode by Ghost
September 15, 2023, 08:42:24 am

Gallery Selection List Order by mickjav
September 07, 2023, 12:46:31 pm

[Mod]Tidy Child Boards 2.0 by Norwinjose
September 02, 2023, 11:42:54 am

PrettyUrls SEO Pro: Unable to submit sitemap to google search conmsole by SMFHacks
August 31, 2023, 10:55:22 am

PrettyURL - SEO4SMF Rewrites? by SMFHacks
August 28, 2023, 06:35:33 pm

Powered by EzPortal