YaBB SE Community

Development => Mod Ideas and Creation => Topic started by: GR8X on March 10, 2004, 01:20:25 PM

Title: Member Groups
Post by: GR8X on March 10, 2004, 01:20:25 PM
Just a couple things I would hope you can help me with...
Regards, Andy Wilson  ;)
Title: Re:Member Groups
Post by: Chris Cromer on March 10, 2004, 02:09:31 PM
The first 2 are not currently possible in YaBBSE and would require a mod.

The third however is in YaBBSE. Just create a membergroup. Then go into the section to manage categories. Then place that group in the categories access part and then that category will only be accessable by that group.
Title: Re:Member Groups
Post by: Shadow's Pawn on March 10, 2004, 08:54:49 PM
If you aren't scared of messing with the code, open up Load.php and check out how things are defined for membergroups based on posts.

I modded a friend's board to make all their membergroups karma based instead of post based.  It was really easy.

Here is an example:

Code: [Select]
   if ($userprofile[$user]['posts'] > $GodPostNum)
   {
      $memberinfo[$user] = "$membergroups[6]";
      $memberstar[$user] = "<img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" /><img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" /><img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" /><img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" /><img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" />";
   }


you could change it to something like this:

Code: [Select]
if (($userprofile[$user]['karmaGood'] - $userprofile[$user]['karmaBad']) > 120)
   {
      $memberinfo[$user] = $txt[rank6];
   }
Title: Re:Member Groups
Post by: GR8X on March 11, 2004, 03:22:26 AM
Chars, I'll try that! Oh and do uz know how to make more member groups like God, Junoir member, ect.
(the ones based around how many posts u have, or in my case karma?)
Title: Re:Member Groups
Post by: Shadow's Pawn on March 11, 2004, 11:13:03 AM
Looking more at Load.php...  Notice how under GodPostNum there is another line that looks like this:

Code: [Select]
   elseif ($userprofile[$user]['posts'] > $SrPostNum)
   {
      $memberinfo[$user] = "$membergroups[5]";
      $memberstar[$user] = "<img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" /><img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" /><img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" /><img src=\"$imagesdir/star.gif\" border=\"0\" alt=\"*\" />";
   }

Well you can add more lines similar to that.  Where is says $memberinfo[user] is where it defines what title they will get... in this case, it is $membergroups[5], which will be whatever you decided to name your Sr Post group.
Just copy and paste the existing membergroups in Load.php and then edit them to suit what you want.  You have to realize, however, that you will have to hardcode in the numbers that determine how much karma they need to get a certain title.

You could make it so you can change the numbers in modsettings, but that would be a lot more difficult than just hardcoding them in.

Here is an example:

Code: [Select]
   /* create the memberinfo and memberstars entries */
   if (($userprofile[$user]['karmaGood'] - $userprofile[$user]['karmaBad']) > 800)
   {
      $memberinfo[$user] = $txt[rank27];
   }
   elseif (($userprofile[$user]['karmaGood'] - $userprofile[$user]['karmaBad']) > 700)
   {
      $memberinfo[$user] = $txt[rank26];
   }
   elseif (($userprofile[$user]['karmaGood'] - $userprofile[$user]['karmaBad']) > 680)
   {
      $memberinfo[$user] = $txt[rank25];
   }
   elseif (($userprofile[$user]['karmaGood'] - $userprofile[$user]['karmaBad']) > 650)
   {
      $memberinfo[$user] = $txt[rank24];
   }
   elseif (($userprofile[$user]['karmaGood'] - $userprofile[$user]['karmaBad']) > 620)
   {
      $memberinfo[$user] = $txt[rank23];
   }
   elseif (($userprofile[$user]['karmaGood'] - $userprofile[$user]['karmaBad']) > 590)
   {
      $memberinfo[$user] = $txt[rank22];
   }

Just make sure that the first one says if and the rest say elseif except for the very last one would should just say else not elseif.

I hope I explained that well enough, if not let me know and I'll try to help you out.
Title: Re:Member Groups
Post by: GR8X on March 11, 2004, 03:04:56 PM
Nope, done exactly what u sed but nothing is happening.
Perhaps u could send me the load.php with these features included in it as this would be very useful to me.  ;)

Can u send attachments on here? If not just send it to my e-mail address.

THANX Anyway  ;D
Title: Re:Member Groups
Post by: GR8X on March 13, 2004, 05:59:41 PM
Can someone please make me a copy of this. It's very urgent!!!
Just the general load.php with no mods attached.

PLEASE HELP!!!
Title: Re:Member Groups
Post by: GR8X on March 19, 2004, 05:21:44 PM
YUS!!!
Got it sorted now! Thanks alot shadows Pawn!!!  ;D