Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4220
Latest: agolac
New This Month: 1
New This Week: 1
New Today: 0
Stats
Total Posts: 42854
Total Topics: 7464
Most Online Today: 112
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 37
Total: 37

Author Topic: Just one more thing...  (Read 2939 times)

0 Members and 1 Guest are viewing this topic.

Offline Garth

  • Member
  • *
  • Posts: 14
    • View Profile
Just one more thing...
« 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! :)

Offline Garth

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Just one more thing...
« Reply #1 on: September 15, 2012, 05:15:41 pm »
Thoughts on this?

Code: [Select]
$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 »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16257
    • View Profile
Re: Just one more thing...
« Reply #2 on: September 16, 2012, 01:57:21 am »
Code looks good just make sure you have it in the right spot.
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
4319 Views
Last post September 03, 2006, 08:37:34 am
by SMFHacks
0 Replies
5622 Views
Last post May 04, 2007, 04:03:52 am
by dimdom
1 Replies
3797 Views
Last post November 09, 2007, 08:16:24 am
by Omikron 9861
0 Replies
2977 Views
Last post July 09, 2008, 02:12:35 pm
by themarker0
1 Replies
4986 Views
Last post April 19, 2013, 10:44:46 am
by Labradoodle-360

+- Recent Topics

Is the PayPal Sandbox still working? by Nicole
Today at 06:51:18 am

Question on Completed Listing & Reserve Price by Nicole
June 01, 2023, 06:06:12 pm

[Mod]GDPR Helper by Nicole
May 29, 2023, 11:58:49 pm

RSS Feed Poster Database Error by SMFHacks
May 22, 2023, 06:26:18 pm

Errors With Older Version. by Ken.
May 09, 2023, 05:35:40 pm

Pretty Urls SEO Pro by SMFHacks
May 06, 2023, 03:30:11 pm

New Post Image Upload Error by Mike66
April 28, 2023, 07:30:28 am

Copyright Removal Key by SMFHacks
April 03, 2023, 02:44:28 pm

Converting from Aeva Media by sudhakar
April 02, 2023, 11:09:54 am

Using SMF's Built-in Search Algorithm by shuban
March 27, 2023, 09:15:10 am

Powered by EzPortal