Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43294
Total Topics: 7523
Most Online Today: 124
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 104
Total: 105

Author Topic: Badge for registering  (Read 7438 times)

0 Members and 1 Guest are viewing this topic.

Offline Garth

  • Member
  • *
  • Posts: 14
    • View Profile
Badge for registering
« on: September 20, 2012, 04:11:45 pm »
How do you give a badge when someone registers? No other requirements other than registering. I'd like to notify new members about the badge system the instant they register to get them involved in it from the off, and I figure a 'welcome to the forum' badge would be a good way to do that! :)

Maybe this functionality is there already? I've got some of the default badges turned off at the moment...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Badge for registering
« Reply #1 on: September 20, 2012, 04:15:14 pm »
Would be a custom badge but would be possible to build.
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 pavshinAN

  • Member
  • *
  • Posts: 1
    • View Profile
Re: Badge for registering
« Reply #2 on: September 29, 2012, 12:11:34 am »
 I've got some of the default badges turned off at the moment..

Offline RGyaznoff

  • Member
  • *
  • Posts: 1
    • View Profile
Re: Badge for registering
« Reply #3 on: October 10, 2012, 08:26:09 am »
about the badge system the instant they register to get them involved in it from the off, and I figure a 'welcome to the forum' badge would be a good way to do that!

Offline MechSpecs

  • Member
  • *
  • Posts: 10
    • View Profile
Re: Badge for registering
« Reply #4 on: April 08, 2014, 12:36:16 am »
This is something I am also looking in to.

I know that the basic badges, included with the mod, are coded to behave a certain way (ie: on 1000 posts, on 1 post etc) I am trying to hunt down that data so that I can alter some of the basic badges to behave the way I wish them to (ie: 3 different badges to be granted upon the 1st post).

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Badge for registering
« Reply #5 on: April 08, 2014, 10:27:19 am »
It would be in sources badge awards
The code would be lik this except you would have a different badgeAction passed
Code: [Select]
// Post Badges
$badgeAction = 'posts1';
if ($memberContext[$memberID]['posts'] >= 1 && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}
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 MechSpecs

  • Member
  • *
  • Posts: 10
    • View Profile
Re: Badge for registering
« Reply #6 on: April 08, 2014, 10:56:45 am »
That did it! I was able to easily add 3 new triggers for their first post and viola, all done. Cheers.

Offline MechSpecs

  • Member
  • *
  • Posts: 10
    • View Profile
Re: Badge for registering
« Reply #7 on: April 08, 2014, 11:09:48 am »
Hrmmmmm, ran in to a problem with this...

Code: [Select]
$badgeAction = 'firstpost1';
if ($memberContext[$memberID]['posts'] >= 1 && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}

The problem is that even if I have other badges and over 200 posts, the very next post I make it gives me the three badges I set up. I was hoping to have it set to only give these badges on the FIRST post, not the 256th post LOL

UPDATE:

The way I got around this was to use the following code...

Code: [Select]
$badgeAction = 'firstpost1';
if ($memberContext[$memberID]['posts'] < 2 && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}

This way any poster with LESS THAN 2 posts (the < symbol worked here) gets the badge but anyone with 2 OR more posts will not get it the badge.
« Last Edit: April 08, 2014, 11:25:46 am by MechSpecs »

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
4077 Views
Last post December 26, 2007, 06:09:47 pm
by RWL
1 Replies
4256 Views
Last post January 28, 2008, 09:15:07 am
by draggar
1 Replies
3675 Views
Last post June 07, 2012, 05:40:14 pm
by SMFHacks
1 Replies
2715 Views
Last post August 23, 2012, 01:55:20 pm
by SMFHacks
13 Replies
8951 Views
Last post May 07, 2018, 01:11:12 pm
by SMFHacks

+- Recent Topics

Please Help! by fmofmpls
Today at 01:47:09 pm

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

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

Powered by EzPortal