Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 161
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 142
Total: 142

Author Topic: Birthdate Badge  (Read 5349 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: 16452
    • 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: 16452
    • 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: 16452
    • 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: 16452
    • 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: 16452
    • 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
4256 Views
Last post January 28, 2008, 09:15:07 am
by draggar
5 Replies
4266 Views
Last post August 22, 2012, 11:21:06 am
by SMFHacks
0 Replies
2490 Views
Last post June 07, 2012, 12:41:05 pm
by FrizzleFried
0 Replies
2292 Views
Last post June 07, 2012, 01:08:47 pm
by FrizzleFried
1 Replies
3676 Views
Last post June 07, 2012, 05:40:14 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

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

Powered by EzPortal