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: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 284
Total: 284

Author Topic: Birthdate Badge  (Read 5317 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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
4243 Views
Last post January 28, 2008, 09:15:07 am
by draggar
5 Replies
4253 Views
Last post August 22, 2012, 11:21:06 am
by SMFHacks
0 Replies
2476 Views
Last post June 07, 2012, 12:41:05 pm
by FrizzleFried
0 Replies
2285 Views
Last post June 07, 2012, 01:08:47 pm
by FrizzleFried
1 Replies
3651 Views
Last post June 07, 2012, 05:40:14 pm
by SMFHacks

+- 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