vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Rank Ordering (https://vborg.vbsupport.ru/showthread.php?t=319659)

MarkFL 07-28-2015 09:00 PM

Rank Ordering
 
1 Attachment(s)
This product will, upon installation, add a column to your "ranks" table labeled "rankorder" and will edit your "/admincp/ranks.php" and "/includes/functions_ranks.php" files so that you may assign display ordering for your defined ranks. The original code is stored as "/admincp/ranks_orig.php" and "/includes/functions_ranks_orig.php" respectively. When uninstalled, your database and files are restored to their original condition.

This add-on utilizes code written by DragonBlade and n8td as posted here:

where do I change the order of rank images?

This add-on simply automates all of the file edits and the database change into one easy step. :cool:

When you go to your "User Rank Manager" you will see a new field titled "Rank Order" associated with each defined rank:

https://vborg.vbsupport.ru/external/2015/07/17.jpg

And when you edit a rank, you will find a new field on the form into which you can set the rank order:

https://vborg.vbsupport.ru/external/2015/07/17.jpg

Rank ordering can be used to control the order in which your various ranks are displayed in user postbits and profile pages. The smaller the number, the higher in the stack a rank will be displayed.

For example, suppose you have a rank for the forum owner(s) and you want this to be on top regardless of the other ranks the owners might have. You could assign this rank a rank order of 0. Then you may have several ranks which indicate a user's position in your staff, such as administrators, global moderators, forum moderators, etc. No one user would have more than 1 of these ranks, and so you could assign these a rank order of 1. This way any of the owners who are also an admin/global mod/mod would have the site owner rank on top and then their staff position rank next.

In this manner, you can assign rank orders to completely control the order in which all of your ranks are displayed:

https://vborg.vbsupport.ru/external/2015/07/17.jpg

Note: Once you edit your ranks to assign the rank order, you must run "update user titles and ranks" in order for the ordering to take effect.

Update: version 1.1
  • Added missed file edit which allows for new ranks to be successfully added after installing this add-on.

Update: version 1.2
  • Reads path to admin control panel folder from config.php.

Note: If you have not renamed your "admincp" folder, then you don't need to update to v. 1.2. If you edited the v. 1.1 .XML file to use your renamed "admincp" folder, then you also don't need to upgrade to v. 1.2. If you do decide to upgrade to v. 1.2 anyway, then you need to uninstall v. 1.1 first. If you wish to keep the rank ordering you've already defined, then you need to edit the product's uninstall code to remove the following db query:

PHP Code:

// Remove "rankorder" column from "ranks" table

$vbulletin->db->hide_errors();
$vbulletin->db->query_write("
    ALTER TABLE`" 
TABLE_PREFIX "ranks`
        DROP COLUMN rankorder
"
); 

To Install:

In AdminCP go to Plugins & Products -> Manage Products -> Add/Import Product.

Click on "Choose File" and browse to the product .xml file that was packaged in the .zip file.

Click "Import"

There are no settings to set, once installed, the product is active. :up:

Note: When updating your vB, please follow these steps after completing the upgrade:

First, delete the files "/includes/functions_ranks_orig.php" and "admincp/ranks_orig.php".

Next, edit the "Rank Ordering" product to remove the uninstall code completely and save it.

Then, uninstall the product.

Lastly, reinstall the product, and the new PHP files will be backed up and then edited, and you'll be back in business. :)

Support for this product can be found here:

SpikeyWelsh 07-29-2015 11:57 AM

thank you so much for the mod works so well :)

fatal rseort 07-31-2015 12:52 AM

Works flawlessly, thanks. :)

fatal rseort 07-31-2015 01:43 AM

Possible bug, but it seems when you try to add a new user rank with the mod installed you get a Database error. Assuming this was the problem as when I uninstalled it I was able to add the rank without a problem.

MarkFL 07-31-2015 01:50 AM

Quote:

Originally Posted by fatal rseort (Post 2551764)
Possible bug, but it seems when you try to add a new user rank with the mod installed you get a Database error. Assuming this was the problem as when I uninstalled it I was able to add the rank without a problem.

Okay, yes I am getting the same issue...thank you for letting me know and I will get it resolved ASAP. :)

MarkFL 07-31-2015 02:14 AM

Update: version 1.1
  • Added missed file edit which allows for new ranks to be successfully added after installing this add-on.

Skyrider 08-02-2015 06:56 AM

At installation, getting:

Quote:

PHP Warning: file_get_contents(./admincp/ranks.php): failed to open stream: Permission denied in ..../includes/adminfunctions_plugin.php(1201) : eval()'d code on line 11

PHP Warning: file_put_contents(./admincp/ranks_orig.php): failed to open stream: Permission denied in ..../includes/adminfunctions_plugin.php(1201) : eval()'d code on line 13

PHP Warning: file_put_contents(./admincp/ranks.php): failed to open stream: Permission denied in ..../includes/adminfunctions_plugin.php(1201) : eval()'d code on line 35

PHP Warning: file_get_contents(./admincp/ranks.php): failed to open stream: Permission denied in ..../includes/adminfunctions_plugin.php(1201) : eval()'d code on line 1

PHP Warning: file_put_contents(./admincp/ranks.php): failed to open stream: Permission denied in ..../includes/adminfunctions_plugin.php(1201) : eval()'d code on line 5
on vB 4.2.3. That's because our admincp directory has a different name. Maybe handy to include in the code to use the config.php admincp directory path instead.

After altering the paths, I've changed the ranking order for 2 ranks, one being 0 and the other being 1. (also tried one being 1, and the second being 2). But the rank order doesn't seem to change.

MarkFL 08-02-2015 07:25 AM

I will look into parsing the config.php file. :)

Do you mean the value shown in the rank manager doesn't change, or the order in which the ranks are displayed in the postbits doesn't change?

Skyrider 08-02-2015 07:27 AM

Sorry for not being clear about that! The ranks in the postbit doesn't change.

MarkFL 08-02-2015 07:32 AM

Did you run "update user titles and ranks?"


All times are GMT. The time now is 11:56 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01272 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete