The BoardMod Project
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum
BoardMod Support Forum
[ Home | Help | Search | Login | Register ]  

10.09.10 at 21:38:18, Welcome, Guest. Please Login or Register

Choose Language:
Pages: 1 2 
How To Add More User Levels (Read 6738 times)
Dave Baughman
VIP
*****
Offline

Murfreesboro, Tennessee, USA
Posts: 2038



08.06.01 at 23:10:43  
Step 1)

Open up the Load.pl file. This is the only file we'll be needing to edit, so this shouldn't be too hard.

Find this section:
Code:
      if( $userprofile{$user}->[6] > $GodPostNum ) {
           $memberinfo{$user} = "$membergroups[6]";
           $memberstar{$user} = qq~<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="*">~;
     }
     elsif( $userprofile{$user}->[6] > $SrPostNum ) {
           $memberinfo{$user} = "$membergroups[5]";
           $memberstar{$user} = qq~<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="*">~;
     }
     elsif( $userprofile{$user}->[6] > $FullPostNum ) {
           $memberinfo{$user} = "$membergroups[4]";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     elsif( $userprofile{$user}->[6] > $JrPostNum ) {
           $memberinfo{$user} = "$membergroups[3]";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     else {
           $memberinfo{$user} = "$membergroups[2]";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*">~;
     }

Okay, what that section does it this: It sees if the users post is greater than the number you have set in your settings.pl to be the God status posting number. If it's not, it sees if it's greater than the Senior level posting number. If not, it keeps going down the list, and finally if it's not greater than any posting level numbers, it sets the users status to newbie. Now, for the purpose of this tutorial, I'm gonna add three new levels. I'm also going to go into my admin center and change the first five setting levels, so 0-25 posts will be a newbie, 26-50 posts is a junior member, 51-100 posts is a full member, 101-150 posts is a senior member, and 151-200 posts is a god member. My three NEW status levels will be Hercules (201-250  posts), Titan (251-300 posts), and Zeus (500 posts and up). Here's what it's gonna look like:
Code:
      if( $userprofile{$user}->[6] > 500 ) {
           $memberinfo{$user} = "Zeus";
           $memberstar{$user} = qq~<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="*"><img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     elsif( $userprofile{$user}->[6] > 250 ) {
           $memberinfo{$user} = "Titan";
           $memberstar{$user} = qq~<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="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     elsif( $userprofile{$user}->[6] > 200 ) {
           $memberinfo{$user} = "Hercules";
           $memberstar{$user} = qq~<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="*">~;
     }
     elsif( $userprofile{$user}->[6] > $GodPostNum ) {
           $memberinfo{$user} = "$membergroups[6]";
           $memberstar{$user} = qq~<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="*">~;
     }
     elsif( $userprofile{$user}->[6] > $SrPostNum ) {
           $memberinfo{$user} = "$membergroups[5]";
           $memberstar{$user} = qq~<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="*">~;
     }
     elsif( $userprofile{$user}->[6] > $FullPostNum ) {
           $memberinfo{$user} = "$membergroups[4]";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     elsif( $userprofile{$user}->[6] > $JrPostNum ) {
           $memberinfo{$user} = "$membergroups[3]";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     else {
           $memberinfo{$user} = "$membergroups[2]";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     
See the changes? We made the god posting level into and elsif statement from and if statement because the highest level need to go first. The first check is always an "if" check, all the middle ones should be "elsif" checks, and the last should be "else". You can make as many member levels as you want using this method. Hope this tutorial helps. =)

- DaveB
 http://www.davesworldzone.com
« Last Edit: 08.06.01 at 23:39:26 by Dave Baughman »  
IP Logged
 

I'm not sure if it's ignorance or apathy, but I don't know and I don't care.
johnsirach
Bloody Novice
*
Offline

Posts: 3



Reply #1 - 22.06.01 at 07:48:57  
This one is verry cool i gonna do it rihgt now on my board!!!!  Cheesy
 
IP Logged
 
dOCdaS
Moderator
*****
Offline

Germany, Schleswig-Holstein, Germany
Posts: 1568



Reply #2 - 17.07.01 at 15:33:11  
Lol, why don't you wait for "Add more MemberGroups" Mod? Would be much easier then! It will be released this week!
 
IP Logged
 

...
Gobalopper
Hacker Wannabe
**
Offline

Posts: 89



Reply #3 - 27.07.01 at 09:20:20  
They don't show up when you click the user's profile, not sure why yet, but if I do I will report back. I am guessing you need to edit something in Profile.pl too.

---
I think it is somewhere in here, but I don't know what I would be changing... Smiley
Code:
      if($settings[7] eq 'Administrator') {
           $position='';
           foreach $curl (@lines) {
                 if($curl ne $lines[1] && $curl ne $lines[2] && $curl ne $lines[3] && $curl ne $lines[4] && $curl ne $lines[5] && $curl ne $lines[6]) {
                       if($curl ne $lines[0]) { $position= qq~$position<option>$curl~; }
                       else { $position= qq~$position<option value="Administrator">$curl~; }
                 }
           }
           if($memsettings[7] eq 'Administrator') { $tt = $lines[0]; }
           else { $tt = $memsettings[7]; }
           print <<"EOT";
 
IP Logged
 
Unknown553
Hacker Expert
****
Offline

Posts: 298



Reply #4 - 01.08.01 at 00:16:11  
if you add mroe membergroups this way, can you still give people special titles?? I installed the more member groups mod and it works, but i cant give members another title Undecided
 
IP Logged
 
Gobalopper
Hacker Wannabe
**
Offline

Posts: 89



Reply #5 - 01.08.01 at 07:53:58  
Yep I am pretty sure you can, the only bug I have found is the profile display of rank not showing up properly.
 
IP Logged
 
jonnytyson
Bloody Novice
*
Offline

Posts: 9



Reply #6 - 23.08.01 at 14:33:39  
what tha......
is this 4 the UBB or this YaBB ?????
i need a hacker 2 help me on my UBB tho..
plz reply if any  1 will help  Cry Laterz!
 
IP Logged
 
Michael Prager
Mod God
*****
Offline

Germany, Hessen, Germany
Posts: 6287



Reply #7 - 23.08.01 at 15:22:13  
This is only for YaBB!
 
IP Logged
 


...  
 _____                   _  _____         _
| __  | ___  ___  ___  _| ||     | ___  _| |
| __ -|| . || .'||  _|| . || | | || . || . |
|_____||___||__,||_|  |___||_|_|_||___||___|
Gobalopper
Hacker Wannabe
**
Offline

Posts: 89



Reply #8 - 17.12.01 at 09:46:42  
Here is a fix for getting it to work in profiles. This works in SP1 I don't know about Gold.

First find this in Profile.pl
Code:
      if($memsettings[6] > $GodPostNum) { $memberinfo = "$membergroups[6]"; }
     elsif($memsettings[6] > $SrPostNum) { $memberinfo = "$membergroups[5]"; }
     elsif($memsettings[6] > $FullPostNum) { $memberinfo = "$membergroups[4]"; }
     elsif($memsettings[6] > $JrPostNum) { $memberinfo = "$membergroups[3]"; }


And replace it with:
Code:
      if($memsettings[6] > 500 ) { $memberinfo = "Zeus"; }
     elsif($memsettings[6] > 250 ) { $memberinfo = "Titan"; }
     elsif($memsettings[6] > 200 ) { $memberinfo = "Hercules"; }
     elsif($memsettings[6] > $GodPostNum) { $memberinfo = "$membergroups[6]"; }
     elsif($memsettings[6] > $SrPostNum) { $memberinfo = "$membergroups[5]"; }
     elsif($memsettings[6] > $FullPostNum) { $memberinfo = "$membergroups[4]"; }
     elsif($memsettings[6] > $JrPostNum) { $memberinfo = "$membergroups[3]"; }


You can of course change the names used and post levels.
 
IP Logged
 
dvdsecretz
Bloody Novice
*
Offline

Posts: 21



Reply #9 - 20.02.02 at 06:13:53  
hi

can anyone help me with this please?

i edited the user levels in the Load.pl file that were already there to my own names i.e. new member, member, senior member etc.. (see the cose below)

i just made one of my friends a mod who has just joined my forum and his name has 5 green starts and says 'Moderator' but it also says 'New Member' below 'Moderator', but i don't want that these...

how could i get rid of that and let it just display 'Moderator'

please help.. the code is below

dvdsecretz
 
IP Logged
 
dvdsecretz
Bloody Novice
*
Offline

Posts: 21



Reply #10 - 20.02.02 at 06:14:29  
     if($userprofile{$user}->[6] > $GodPostNum) {
           $memberinfo{$user} = "Legend Member";
           $memberstar{$user} = qq~<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="*">~;
     }
     elsif($userprofile{$user}->[6] > $SrPostNum) {
           $memberinfo{$user} = "Senior Member";
           $memberstar{$user} = qq~<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="*">~;
     }
     elsif($userprofile{$user}->[6] > $FullPostNum) {
           $memberinfo{$user} = "Member";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     elsif($userprofile{$user}->[6] > $JrPostNum) {
           $memberinfo{$user} = "Junior Member";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*"><img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     else {
           $memberinfo{$user} = "New Member";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
     if(exists $moderators{$user} && $sender ne "im") {
           $modinfo{$user} = "<i>Moderator</i><BR>";
           $memberstar{$user} = qq~<img src="$imagesdir/starmod.gif" border="0" alt="*"><img src="$imagesdir/starmod.gif" border="0" alt="*"><img src="$imagesdir/starmod.gif" border="0" alt="*"><img src="$imagesdir/starmod.gif" border="0" alt="*"><img src="$imagesdir/starmod.gif" border="0" alt="*">~;
     }
     if($userprofile{$user}->[7] eq 'Administrator') {
           $memberstar{$user} = qq~<img src="$imagesdir/staradmin.gif" border="0" alt="*"><img src="$imagesdir/staradmin.gif" border="0" alt="*"><img src="$imagesdir/staradmin.gif" border="0" alt="*"><img src="$imagesdir/staradmin.gif" border="0" alt="*"><img src="$imagesdir/staradmin.gif" border="0" alt="*">~;
           $memberinfo{$user} = "<B>Administrator</B>";
     }
     if($userprofile{$user}->[7] && $userprofile{$user}->[7] ne 'Administrator') { $groupinfo{$user} = "$userprofile{$user}->[7]<BR>"; }
     if($userprofile{$user}->[7] ne 'Administrator') {
           $memberinfo{$user} = "$modinfo{$user}$groupinfo{$user}$memberinfo{$user}";
     }

     if($userprofile{$user}->[6] > 100000) { $userprofile{$user}->[6] = "$txt{'683'}"; }

     $yyUDLoaded{$user} = 1;
     return 1;
}
 
IP Logged
 
Dave Baughman
VIP
*****
Offline

Murfreesboro, Tennessee, USA
Posts: 2038



Reply #11 - 20.02.02 at 14:40:58  
Please erase those posts and put them in a thread in the help board... this is a tutorial, not a thread for posting code that isn't working. Thanks.
 
IP Logged
 

I'm not sure if it's ignorance or apathy, but I don't know and I don't care.
Darkened
Hacker Wannabe
**
Offline

Posts: 57



Reply #12 - 20.03.02 at 04:01:41  
hey, nice idea, it didn't work for me, just gave me an error page when i refreshed my boards, shame...

but i had an idea... zeus... is male... so what i was thinking is...

if($userprofile{$user} bla = $female, $userprofile{$user}->[6] > 500 ) {
           $memberinfo{$user} = "Hera";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*">~;
     }
elseif($userprofile{$user} bla = $male, $userprofile{$user}->[6] > 500 ) {
           $memberinfo{$user} = "Zeus";
           $memberstar{$user} = qq~<img src="$imagesdir/star.gif" border="0" alt="*">~;
     }

i would try this myself but firstly your mod didn't work for mine and secondly i would have no idea how to get hold of the gender information... so would this work??? Grin
 
IP Logged
 
Shoeb Omar
Mod Writer
*****
Offline

San Diego, California, USA
Posts: 5665



Reply #13 - 20.03.02 at 04:18:52  
it owuldnt be a comma but an && operator Smiley
 
IP Logged
 

YaBB SP2 BETA!
Now taking pay jobs in PHP or Perl.  Contact me for details.
Darkened
Hacker Wannabe
**
Offline

Posts: 57



Reply #14 - 20.03.02 at 05:10:05  
lol, ok mister smarty pants... you know i don't know perl yet you mock me *sobs* lol

it is plausable tho right?
 
IP Logged
 
Pages: 1 2 
© 2000-2009 by - All rights reserved.

SourceForge.net Logo
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum