Facebook 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4291
Latest: Robertqt
New This Month: 5
New This Week: 0
New Today: 0
Stats
Total Posts: 43747
Total Topics: 7590
Most Online Today: 81
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 76
Total: 77

Author Topic: Custom Badges  (Read 19170 times)

0 Members and 1 Guest are viewing this topic.

Offline exit

  • Bad Emails DO NOT EMAIL
  • Jr. Member
  • *
  • Posts: 92
    • View Profile
Re: Custom Badges
« Reply #15 on: May 06, 2018, 04:05:00 pm »
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

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16654
    • View Profile
Re: Custom Badges
« Reply #16 on: May 06, 2018, 04:07:24 pm »
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/

Offline exit

  • Bad Emails DO NOT EMAIL
  • Jr. Member
  • *
  • Posts: 92
    • View Profile
Re: Custom Badges
« Reply #17 on: May 06, 2018, 04:24:05 pm »
Done :D on .svg so it can be easily ported to any size for format.

Attached to the post...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16654
    • View Profile
Re: Custom Badges
« Reply #18 on: May 14, 2018, 02:47:36 pm »
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/

Offline Senkusha

  • Community Suite Customer
  • Member
  • ******
  • Posts: 34
    • View Profile
    • The Kawaii Klub
Re: Custom Badges
« Reply #19 on: February 19, 2025, 07:22:19 am »
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

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16654
    • View Profile
Re: Custom Badges
« Reply #20 on: February 19, 2025, 07:36:15 am »
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
7 Replies
6045 Views
Last post June 09, 2012, 06:03:42 pm
by SMFHacks
1 Replies
3818 Views
Last post June 10, 2012, 09:44:06 am
by SMFHacks
3 Replies
3957 Views
Last post June 18, 2012, 10:49:06 am
by FrizzleFried
1 Replies
4645 Views
Last post October 09, 2012, 08:20:54 am
by Jonas1975
3 Replies
1138 Views
Last post August 18, 2022, 10:10:46 pm
by Hatshepsut

+- Recent Topics

Community suite buying question by SMFHacks
Today at 11:26:20 am

Downloading with Zero Credits? by SMFHacks
March 23, 2025, 01:40:50 pm

Some minor Layout modifications by Senkusha
March 22, 2025, 06:30:31 pm

Uploading Bulk files to a Category? by SMFHacks
March 21, 2025, 08:26:01 pm

Mod for compare gallery.text with board.text by SMFHacks
March 21, 2025, 05:52:46 pm

ST Shop integration by Senkusha
March 18, 2025, 07:33:13 pm

Contact Us by SMFHacks
March 16, 2025, 07:49:23 pm

HTTP 500 error during install by SMFHacks
March 13, 2025, 10:44:31 am

Site upgrade to 2.1 by SMFHacks
March 12, 2025, 09:29:43 pm

[Mod]WebP and AVIF File Support for SMF 2.1 by SMFHacks
March 10, 2025, 04:32:57 pm

Powered by EzPortal