Twitter SMFHacks Facebook SMFHacks SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 23, 2013, 08:15:44 am

Login with username, password and session length
Members
Total Members: 10768
Latest: tuberose
Stats
Total Posts: 32388
Total Topics: 5479
Online Today: 69
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 40
Total: 40
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Go Down Print
Author Topic: Few Issues  (Read 1151 times)
shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« on: June 02, 2012, 05:12:53 pm »

Hello again,

Issue 1

I have a mod that automatically gives new users a "default avatar".

http://custom.simplemachines.org/mods/index.php?mod=975

As a result, all new members are automatically earning the "Avatar Award". How could I prevent these new users from getting this award if they haven't actually changed their default avatar?

Issue 2

When brand new members make a post (not a new topic), they are earning the "Topic Starter" award for some reason. Is this supposed to happen? How do I correct it?
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11000


View Profile
« Reply #1 on: June 02, 2012, 05:34:36 pm »

New update posted
For #1
You would have to add a check to avatar badge check in
Sources/badgawards.php if the avatar equals the default avatar then ignore the award

Code:

$badgeAction = 'avatar';
if ($memberContext[$memberID]['avatar']['image'] != '' && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
AddBadgeToMember($memberID,$badgeID,false);
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;

}
I put what I think may work in comments around that block in the update.


#2. Fixed in latest update
Logged
shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« Reply #2 on: June 02, 2012, 05:59:33 pm »

New update posted
For #1
You would have to add a check to avatar badge check in
Sources/badgawards.php if the avatar equals the default avatar then ignore the award

Code:

$badgeAction = 'avatar';
if ($memberContext[$memberID]['avatar']['image'] != '' && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
AddBadgeToMember($memberID,$badgeID,false);
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;

}
I put what I think may work in comments around that block in the update.

How would I do it? All members start with http://biology-forums.com/avatars/Default_Avatar.png as their default avatar.

Also, where do I download the latest update? All I see is Presales under Badge Awards
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11000


View Profile
« Reply #3 on: June 02, 2012, 06:00:31 pm »

Enter your license key under
http://www.smfhacks.com/index.php?action=license
And that should give you access to the badges downloads forum.
Logged
shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« Reply #4 on: June 02, 2012, 06:07:57 pm »

Enter your license key under
http://www.smfhacks.com/index.php?action=license
And that should give you access to the badges downloads forum.

Did so already, as you can tell, my website is in showcase Smiley Just not showing.
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11000


View Profile
« Reply #5 on: June 02, 2012, 06:16:31 pm »

Enter your license key under
http://www.smfhacks.com/index.php?action=license
And that should give you access to the badges downloads forum.

Did so already, as you can tell, my website is in showcase Smiley Just not showing.
Fixed added you to the Badge Awards custom group try to the downloads forums again.
Logged
shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« Reply #6 on: June 02, 2012, 06:35:38 pm »

New update posted
For #1
You would have to add a check to avatar badge check in
Sources/badgawards.php if the avatar equals the default avatar then ignore the award

Code:

$badgeAction = 'avatar';
if ($memberContext[$memberID]['avatar']['image'] != '' && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
AddBadgeToMember($memberID,$badgeID,false);
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;

}
I put what I think may work in comments around that block in the update.

So, will this work?

Code:
$badgeAction = 'avatar';
if ($memberContext[$memberID]['avatar']['image'] != '' && !in_array($badgeAction,$currentBadges))
{

if  ($modSettings['attachmentDefaultavatar'] != $memberID]['avatar']['image'])
{
$badgeID = GetBadgeIDByAction($badgeAction);
AddBadgeToMember($memberID,$badgeID,false);
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}
}

I'm assuming this checks if a default avatar is there...
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11000


View Profile
« Reply #7 on: June 02, 2012, 06:37:22 pm »

Yeah hopefully untested though.
Logged
shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« Reply #8 on: June 02, 2012, 06:43:48 pm »

Yeah hopefully untested though.

When I removed the //

It didn't work, error...
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11000


View Profile
« Reply #9 on: June 02, 2012, 06:48:36 pm »

Oops should be
Code:
if  ($modSettings['attachmentDefaultavatar'] != $memberContext[$memberID]['avatar']['image'])
{
$badgeID = GetBadgeIDByAction($badgeAction);
AddBadgeToMember($memberID,$badgeID,false);
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

Logged
shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« Reply #10 on: June 02, 2012, 06:50:42 pm »

Here's another issue, even after disabling the "Level x" awards, in the email sent, it still sayings you've earned the "Level 1" award. I don't think it's disabling the awards correctly.
Logged

shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« Reply #11 on: June 02, 2012, 06:54:59 pm »

Oops should be
Code:
if  ($modSettings['attachmentDefaultavatar'] != $memberContext[$memberID]['avatar']['image'])
{
$badgeID = GetBadgeIDByAction($badgeAction);
AddBadgeToMember($memberID,$badgeID,false);
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}


That didn't work...

Also, when brand new members make their first post, they no longer get an award...
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11000


View Profile
« Reply #12 on: June 02, 2012, 06:56:10 pm »

In the pm/email or are they just be awarded to the users.
Are level awards disabled completely?
Logged
shuban
Badge Awards Customer
Full Member
*****
Offline Offline

Posts: 164


View Profile WWW
« Reply #13 on: June 02, 2012, 06:58:49 pm »

Quote
Are level awards disabled completely?

I disabled them from the settings in admin, unclicked enable.
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11000


View Profile
« Reply #14 on: June 02, 2012, 07:15:17 pm »

Just posted update to fix the enabled issue. Changes were just to the badgeawards.php file.
Logged
Pages: [1] 2 Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 04:50:21 am]

[May 22, 2013, 10:03:30 pm]

[May 22, 2013, 03:00:09 pm]

[May 22, 2013, 03:03:31 am]

[May 21, 2013, 03:27:16 pm]

[May 21, 2013, 02:11:10 pm]

[May 21, 2013, 01:18:58 pm]

[May 21, 2013, 12:22:02 am]

[May 21, 2013, 12:20:41 am]

[May 19, 2013, 11:13:02 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 1.42 seconds with 21 queries.