miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
How To miniBB Support Forums / How To /  
 

Static rankings in User rankings solution?

 
 
Page  Page 1 of 2:  1  2  Next »

Author lutz
Partaker
#1 | Posted: 26 Jul 2006 06:00 
At the moment, the post cell goes something like

USERNAME
VIEWREG

AVATAR

RANKING


The thing is, I don't want VIEWREG Admin to also be RANKING Newbie. Is it possible to create static ranking in

/* Custom ranks function */
//1-300 - newbie
//300-600 - advanced
//600-1000 - prof.
//1000-1500 - writing for living
//1500+ - writer forever

function parseUserInfo_num_posts($val){
if($GLOBALS['action']=='userinfo') return $val-$GLOBALS['row'][10];
else{
if($val>=1 and $val<=300) $rank='newbie';
elseif($val>300 and $val<=600) $rank='advanced';
elseif($val>600 and $val<=1000) $rank='prof.';
elseif($val>1000 and $val<=1500) $rank='writing for living';
elseif($val>1500) $rank='writer forever';
else $rank='';
return '<span class=txtSm>'.$rank.'</span>';
}
}


??

Author Paul
Lead Developer 
#2 | Posted: 26 Jul 2006 09:12 
if($val>=1 and $val<=300 and $GLOBALS['poster_id']!=1) $rank='newbie';

something like that...

OR, for eliminating this thing for admin at all:

function parseUserInfo_num_posts($val){
if($GLOBALS['action']=='userinfo') return $val-$GLOBALS['row'][10];
elseif($GLOBALS['poster_id']!=1){
if($val>=1 and $val<=300) $rank='newbie';
elseif($val>300 and $val<=600) $rank='advanced';
elseif($val>600 and $val<=1000) $rank='prof.';
elseif($val>1000 and $val<=1500) $rank='writing for living';
elseif($val>1500) $rank='writer forever';
else $rank='';
return '<span class=txtSm>'.$rank.'</span>';
}
}

Author lutz
Partaker
#3 | Posted: 26 Jul 2006 09:20 
Wow, that's pretty nifty, and it worked - thanks!

:D

Author ben
Partaker
#4 | Posted: 26 Jul 2006 14:25 
I also had this problem, but it was revolving around custom titles. Is it possible not to have this show for anyone with a custom title? I played with it a bit but couldn't figure out a easy check to see if a userid has a custom title.

Author Paul
Lead Developer 
#5 | Posted: 26 Jul 2006 17:00 
If you mean $userRanks, than it will be something like...

function parseUserInfo_num_posts($val){
if($GLOBALS['action']=='userinfo') return $val-$GLOBALS['row'][10];
elseif($GLOBALS['cols'][0]!=1 and !isset($GLOBALS['userRanks'][$GLOBALS['cols'][0]])){
if($val>=1 and $val<=300) $rank='newbie';
elseif($val>300 and $val<=600) $rank='advanced';
elseif($val>600 and $val<=1000) $rank='prof.';
elseif($val>1000 and $val<=1500) $rank='writing for living';
elseif($val>1500) $rank='writer forever';
else $rank='';
return '<span class=txtSm>'.$rank.'</span>';
}
}

Author ben
Partaker
#6 | Posted: 27 Jul 2006 13:12 
this didn't work, is $userRanks the one set in bb_specials ?

with this code, nothing showed on all titles.

Author Paul
Lead Developer 
#7 | Posted: 27 Jul 2006 17:03 
Ok, I updated the above code. Check out.

Author ben
Partaker
#8 | Posted: 27 Jul 2006 17:11 
still nothing for normal users.

Author Paul
Lead Developer 
#9 | Posted: 27 Jul 2006 21:20 
Well, don't know what the reason is, but it works on my side! Don't forget to insert {$userInfo_num_posts[$poster_id]} as it's mentioned in README for this solution.

Author Anonymous
Guest
#10 | Posted: 2 Nov 2006 04:28 
I also have the custom ranks depending on number of posts, but cannot figure out how to make a separate rank that stays for admin. can anyone help?

Author Anonymous
Guest
#11 | Posted: 2 Nov 2006 04:40 
oh, nvm i figured it out.

elseif($poster_id=1) $rank='CUSTOMRANK';

^_^

Author Anonymous
Guest
#12 | Posted: 2 Nov 2006 13:22 
weird, it worked last night. i didnt change anything and now it doesn't work anymore. goes back to the custom ranks determined by post, instead of a statice one defined with the code above...

anyone know why that happened?

Author Paul
Lead Developer 
#13 | Posted: 2 Nov 2006 13:34 
How can anyone know what happened, if it worked :)))

Author Anonymous
Guest
#14 | Posted: 3 Nov 2006 13:01 
hmm, it didn't work after all.

i tried using the code you posted, Paul. But it didn't work for me. Is there anything else I can try? How can I make exceptions in bb_plugins for people who have ranks set up in $userRanks from bb_specials?

Author Paul
Lead Developer 
#15 | Posted: 3 Nov 2006 15:30 
Unfortunatelly, I don't know what you are doing wrong and where to fix the error. We're investigating such kind of problems only for a fee.

The code shown is exactly the same on minibb test forums. For example, if you check this thread:

http://minibb.org/minibb-test.php?action=vthread&forum=2& topic=429

you will see that Moderator has a 'newbie' tag (as he has less than 300 posts), but tester has no custom tag, but custom ranking "Test Account" is written in instead. As it is defined in bb_specials.php:

$userRanks=array(75=>'Test Account');

Page  Page 1 of 2:  1  2  Next » 
How To miniBB Support Forums / How To /
 Static rankings in User rankings solution?
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑