Twitter SMFHacks Facebook SMFHacks SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
June 18, 2013, 03:42:32 pm

Login with username, password and session length
Members
Total Members: 10807
Latest: GoldDigger1950
Stats
Total Posts: 32556
Total Topics: 5506
Online Today: 80
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 54
Total: 54
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Couple of questions  (Read 2577 times)
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« on: September 10, 2012, 10:25:40 am »

Hi, this looks like a cool mod, just have a couple of noob questions before I buy!

1. Can you create an award given only when members reply to a specific topic?
2. My forum has close to 6000 members - if I activate awards that are based on post counts for instance, will all the relevant awards be given retroactively, and how server intensive would running this mod on a forum that size be?

Cheers!
« Last Edit: September 10, 2012, 10:43:58 am by Garth » Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11050


View Profile
« Reply #1 on: September 10, 2012, 11:51:38 am »

1. Nothing built in but I could help write a custom badge for you if you reply to that topic it would award a specific badge.

2. Yes we have the system setup on install auto rebadges members. It does it chunks I believe 50 members at a time so it doesn't use up a lot of resources.
Logged
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« Reply #2 on: September 13, 2012, 08:32:30 am »

Sold! Grin
Logged
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« Reply #3 on: September 13, 2012, 03:22:22 pm »

Mod installed, could do with assistance with the specific topic badge - cheers! Smiley
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11050


View Profile
« Reply #4 on: September 13, 2012, 08:41:06 pm »

This code assumes SMF 2.0 and will award badges to any member that posts in that topic

Requires you to create a custom badge in the add badge area with the action called topicbadge7079


Open Sources/Subs-Post.php

Find
Code:
// They've posted, so they can make the view count go up one if they really want. (this is to keep views >= replies...)

Add after
Code:
// Badge Awards
global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

global $sourcedir;
require_once($sourcedir . '/badgeawards2.php');
if ($topicOptions['id'] == 7079)
{

Badges_AwardBadge($posterOptions['id'],'topicbadge7079');
}

}
// End Badge Awards
Logged
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« Reply #5 on: September 13, 2012, 09:32:39 pm »

That works just great, many thanks! Grin
Logged
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« Reply #6 on: September 14, 2012, 07:34:07 pm »

Would any problems occur if I add a bunch of elseif statements to this custom badge so I can check for multiple topic ids and award a different badge for each one?

Like this:
Code:
// Badge Awards
global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

global $sourcedir;
require_once($sourcedir . '/badgeawards2.php');
if ($topicOptions['id'] == 7079)
{

Badges_AwardBadge($posterOptions['id'],'topicbadge7079');
}

elseif ($topicOptions['id'] == 9000)
{

Badges_AwardBadge($posterOptions['id'],'topicbadge9000');
}

elseif ($topicOptions['id'] == 9500)
{

Badges_AwardBadge($posterOptions['id'],'topicbadge9500');
}

elseif ($topicOptions['id'] == 9900)
{

Badges_AwardBadge($posterOptions['id'],'topicbadge9900');
}

}
// End Badge Awards

But with a lot more elseifs?

I expect there's a better way of doing that but I'm a bit of a noob!
« Last Edit: September 14, 2012, 07:49:03 pm by Garth » Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11050


View Profile
« Reply #7 on: September 14, 2012, 07:51:15 pm »

That will work fine!
Logged
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« Reply #8 on: September 14, 2012, 08:08:50 pm »

If I add about 50 of those would it still be OK or would it bog down the forum? Sorry for all the questions, I really appreciate your excellent support Grin
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11050


View Profile
« Reply #9 on: September 14, 2012, 08:10:21 pm »

It would be ok since it only checks if that topic matches
Logged
Garth
Badge Awards Customer
Inline PM Customer
*****
Offline Offline

Posts: 14


View Profile
« Reply #10 on: September 14, 2012, 08:28:55 pm »

Awesome, thanks so much!
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 07:27:33 am]

[Today at 06:10:04 am]

[June 17, 2013, 12:27:50 pm]

[June 16, 2013, 08:17:21 pm]

[June 16, 2013, 07:29:04 am]

[June 15, 2013, 08:34:38 pm]

[June 14, 2013, 10:28:18 pm]

[June 13, 2013, 11:00:52 pm]

[June 12, 2013, 03:37:47 am]

[June 12, 2013, 12:47:58 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.436 seconds with 20 queries.