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: 285
Total: 285

Author Topic: Number of Friend Bagde not working...  (Read 3699 times)

0 Members and 1 Guest are viewing this topic.

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Number of Friend Bagde not working...
« on: June 05, 2012, 09:29:20 pm »
I'm trying to incorporate a friend badge and came up with this:

Code: [Select]
$badgeAction = 'friend100';
if ($memberContext[$memberID]['buddies_data'] >= 100 && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}

What am I doing wrong here? Everyone is getting it even though the code says you need 100 friends to get it.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Number of Friend Bagde not working...
« Reply #1 on: June 05, 2012, 09:41:17 pm »
Change to something like this
Code: [Select]

if ($memberContext[$memberID]['buddies_data'] >= 100 && !in_array($badgeAction,$currentBadges))
To
Code: [Select]

if (count($memberContext[$memberID]['buddies']) > 100 && !in_array($badgeAction,$currentBadges))

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: Number of Friend Bagde not working...
« Reply #2 on: June 05, 2012, 09:53:19 pm »
I kept the >= and it worked, thank you :)

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Number of Friend Bagde not working...
« Reply #3 on: June 05, 2012, 09:54:42 pm »
Glad to help.
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
2 Replies
7560 Views
Last post October 05, 2006, 03:07:00 pm
by Rocket 442
4 Replies
4024 Views
Last post July 10, 2007, 11:57:22 pm
by cgtemple
8 Replies
8996 Views
Last post July 01, 2008, 07:34:04 pm
by rgsknr
1 Replies
3401 Views
Last post June 30, 2008, 08:03:08 pm
by SMFHacks
2 Replies
7402 Views
Last post January 25, 2012, 12:53:58 pm
by DimTwinkle

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