The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Reorder User Ranks
I have added about a dozen user ranks in my acp and they are working fine. However, on a user's post, when it shows the ranks, it does not list them in the order I have them entered. The way I have it setup, a user can have multiple rankings (eg. Administrator, over 300 posts, etc).
What determines the order the ranks are shown in? How do I force the system to list ranks in a particular order? Is there a mod out there that allows me to do this? I searched, but did not find anything. |
#2
|
|||
|
|||
Anybody? Anybody?
|
#3
|
||||
|
||||
I think you need to actually change the code. It looks like this is done in includes/functions_ranks.php at the very bottom where it says "Begin Build Ranks PHP Code function"
|
#4
|
|||
|
|||
The problem is that I am not a programmer. I have no idea how to do that. Is there anybody that can give me the "find this, replace with this" instructions?
|
#5
|
||||
|
||||
Sorry, I can't tell you exactly. I'm a trial and error coder and I don't have enough ranks on my test site to be able to test this out myself.
|
#6
|
|||
|
|||
Well, if it is a test site, can't you just make more ranks? You can also use my test site if you wish.
In the function is the line that says "ORDER BY ranks.usergroupid DESC, minposts DESC". Obviously, it is displaying the ranks by usergroup id. However, not being a programmer, I am just guessing here, but if we add a new column to the ranks table in the database and then connect it to the ranks area of the acp for "display order" we can then change that line to "ORDER BY ranks.displayorderid DESC, minposts DESC" or something like this. Am I right? For simplicity sake, can I change the line to something that just replaces "usergroupid" with the rankid? or even list the rank ids in the order I want them displayed? |
#7
|
||||
|
||||
The ranks table has a field called rankid. So yes, you can order by rank.rankid . You can always try that and see. If it doesn't work, then you go back to default (just keep a copy). I think after you change it in the code, you will need to go to the Ranks area in the Admin CP and Save something to get it to rebuild the ranks list.
If you were to write a modification for this, you would probably want to add a column for order. Then you could order by rank.order. And I don't want to add more ranks to my test site because I'm trying to keep it as close to my live site as possible since I want to make the big jump from 3.6 to 3.8 as soon as it goes Gold. |
#8
|
|||
|
|||
Well, knowing that I want to add a rank.order option in the acp and being able to actually do it are two different things. I will wait to see if anybody can do this for me.
Do you know the mysql command to add a column to an existing table? |
#9
|
||||
|
||||
I just add them in phpMyAdmin. But, I did write a product that I shared with someone and this is the query I used to add a new column to the thread table:
Code:
$db->query("ALTER TABLE " . TABLE_PREFIX . "thread ADD verify_status SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL"); If you go for this approach of adding a new 'order' column, don't forget you need to modify the /admincp/ranks.php page to include it on your User Rank page in the Admin CP |
#10
|
|||
|
|||
That looks like the command to add to a php file. What is the command I use in phpMyAdmin?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|