Twitter SMFHacks Facebook SMFHacks SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 22, 2013, 09:53:07 am

Login with username, password and session length
Members
Total Members: 10766
Latest: Heater Sajid
Stats
Total Posts: 32380
Total Topics: 5479
Online Today: 67
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 2
Guests: 45
Total: 47
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Just one more thing...  (Read 884 times)
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« on: September 14, 2012, 11:24:34 am »

Is it possible to modify the badge for posting a topic so that it's only awarded when the topic is posted in a specific board?

Thanks again! Smiley
Logged
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« Reply #1 on: September 15, 2012, 05:15:41 pm »

Thoughts on this?

Code:
$badgeAction = 'topicinboard';
if ($memberContext[$memberID]['posts'] != 0 && !in_array($badgeAction,$currentBadges))
{
$result = $smcFunc['db_query']('', "
SELECT COUNT(*) AS total FROM {db_prefix}topics  
WHERE ID_MEMBER_STARTED = $memberID
AND ID_BOARD = 1
");  
$totalRow = $smcFunc['db_fetch_assoc']($result);

if ($totalRow['total'] > 0)
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}
}

}
« Last Edit: September 15, 2012, 05:28:07 pm by Garth » Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 10997


View Profile
« Reply #2 on: September 16, 2012, 01:57:21 am »

Code looks good just make sure you have it in the right spot.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 03:03:31 am]

[Today at 01:01:03 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]

[May 19, 2013, 08:18:27 pm]

[May 19, 2013, 07:03:27 am]
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.377 seconds with 21 queries.