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: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 233
Total: 233

Author Topic: Just one more thing...  (Read 3096 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: 16436
    • 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
4496 Views
Last post September 03, 2006, 08:37:34 am
by SMFHacks
0 Replies
5755 Views
Last post May 04, 2007, 04:03:52 am
by dimdom
1 Replies
4043 Views
Last post November 09, 2007, 08:16:24 am
by Omikron 9861
0 Replies
3110 Views
Last post July 09, 2008, 02:12:35 pm
by themarker0
1 Replies
5411 Views
Last post April 19, 2013, 10:44:46 am
by Labradoodle-360

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