Facebook 

SMFHacks.com - Celebrating 20 Years!

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4342
Latest: eva
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 44312
Total Topics: 7676
Most Online Today: 607
Most Online Ever: 27044
(May 30, 2026, 09:10:16 pm)
Users Online
Members: 0
Guests: 345
Total: 345

Author Topic: Custom Badges  (Read 28225 times)

0 Members and 0 Guests are viewing this topic.

Re: Custom Badges
« Reply #15 on: »
Hi there, it would be nice to have badges for some of your other popular mods, like trader and classifieds.

For instance:
good trader = > 10 positive feedbacks
Active seller = > 10 ads posted

Re: Custom Badges
« Reply #16 on: »
Yeah would have to have the icons designed.
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/

Re: Custom Badges
« Reply #17 on: »
Done :D on .svg so it can be easily ported to any size for format.

Attached to the post...

Re: Custom Badges
« Reply #18 on: »
I can get them added if you make them transparent and the following sizes
178 x 153
32 x27

If you look at the existing you will note their is a border.
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/

Re: Custom Badges
« Reply #19 on: »
I'm looking to add some specific custom badges to my site.  For example, whenever a member creates five new topics in a specific Board, like "Sailor Moon", they'll become a Sailor Scout, or something.

I'm assuming the logic that would handle this would be found:
badgeawards2.php
function Bades_CheckMember($memberID = 0) {}

And an example module would look something like this:

Code: [Select]
// Sailor Scout

// Get the specific topic count.
// Sailor Moon Board ID is 25.
// Required Count for this award is 5 or more.
$result2 = $smcFunc['db_query'])'', "
SELECT COUNT(*) AS total FROM {$db_prefix}topics
WHERE ID_MEMBER = $memberID AND id_board = 25");
$totalRow = $smcFunc['db_fetch_assoc']($result2);

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

I would need to create the actual badge as well, and add it to the /badges/ folder. Using the sizes of 178x153 and 32x27, on a transparent background, saved as *.png.
-- Senkusha
Creative Pioneer exploring anime role playing adventures!
Visit my Creative Anime Role Playing Community
SMF 2.1.4

Re: Custom Badges
« Reply #20 on: »
Yes exactly. Make sure you also add the badge using the badge award interface and have the action set to SailorScout
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
4 Replies
5513 Views
Last post June 06, 2012, 12:43:03 pm
by FrizzleFried
7 Replies
9258 Views
Last post June 09, 2012, 06:03:42 pm
by SMFHacks
1 Replies
5769 Views
Last post June 10, 2012, 09:44:06 am
by SMFHacks
1 Replies
6608 Views
Last post October 09, 2012, 08:20:54 am
by Jonas1975
3 Replies
4133 Views
Last post August 18, 2022, 10:10:46 pm
by Hatshepsut

+- Recent Topics

Registration - anti bot pattern matching by SMFHacks
November 01, 2026, 07:20:17 pm

EZPortal 8 by davejo
October 21, 2026, 01:01:54 pm

Downloads Pro 7.0 Released by SMFHacks
October 07, 2026, 07:35:30 pm

[Mod]ActivityPub Federation for SMF 2.1 by SMFHacks
October 01, 2026, 05:03:45 pm

Newsletter Pro 4.0 Released by SMFHacks
September 23, 2026, 08:08:24 pm

Can't remove or restore any item from the recycle bin by SMFHacks
September 22, 2026, 11:01:51 am

MCP Server for SMF 2.1 - let Claude, ChatGPT or Cursor run your admin chores by SMFHacks
September 12, 2026, 02:50:45 pm

Suggestions for improvements to Ultimate Shoutbox & Chatroom by davejo
September 02, 2026, 01:35:09 am

Automatic Sorting of Categories by Kiwi
August 31, 2026, 12:36:09 am

' appears as ' in Most Viewed (and Recent Items ?) by SMFHacks
August 22, 2026, 11:01:56 pm

Powered by EzPortal