Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Rank Ordering Details »
Rank Ordering
Mod Version: 1.2, by MarkFL (Coder) MarkFL is offline
Developer Last Online: Mar 2019 I like it Show Printable Version Email this Page

vB Version: 4.x.x Rating: (3 votes - 5.00 average) Installs: 46
Released: 29 Jul 2015 Last Update: 25 May 2017 Downloads: 246
Not Supported DB Changes Code Changes Translations  

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.

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



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



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:



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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.

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:

Download Now

Only licensed members can download files, Click Here for more information.

Supporters / CoAuthors

Screenshots

Click image for larger version

Name:	rankorderlist.png
Views:	1276
Size:	74.2 KB
ID:	153032   Click image for larger version

Name:	rankorderedit.jpg
Views:	1259
Size:	46.3 KB
ID:	153033   Click image for larger version

Name:	rankorderpost.png
Views:	1272
Size:	65.3 KB
ID:	153036  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #46  
Old 05 Feb 2017, 20:13
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Try vpcarrocci's method...
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #47  
Old 05 Feb 2017, 20:41
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
Duplicating exactly what post #40 did also doesn't work here.

The ranks.php file in the created /admincp folder remains unchanged and the second file: ranks_orig.php; doesn't exist/wasn't created.

The same is true of the /includes/functions.php file. It remains unchanged and the second file: functions_orig.php doesn exist/wasn't created.

Installing the MOD didn't present any errors of any kind.
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam

Last edited by Snowhog; 05 Feb 2017 at 20:47.
Reply With Quote
  #48  
Old 06 Feb 2017, 08:14
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by Snowhog View Post
Duplicating exactly what post #40 did also doesn't work here.

The ranks.php file in the created /admincp folder remains unchanged and the second file: ranks_orig.php; doesn't exist/wasn't created.

The same is true of the /includes/functions.php file. It remains unchanged and the second file: functions_orig.php doesn exist/wasn't created.

Installing the MOD didn't present any errors of any kind.
Send the login credentials to an admin account with FTP access to me by PM, and I will try to resolve the issue.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #49  
Old 06 Feb 2017, 19:54
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
I'll do that if it really becomes necessary.

As neither the source files are being changed; date/time stamp isn't changing; and the backup files aren't being created, I thought maybe it's a permission issue, like it was with the other MOD I mucked with.

Both directories; admincontrolpanel and inlcudes; have permissions of 755. The contents of both directories have permissions of 644. I changed the directories to 775 and the two individual .php files to 775 and reran the installation .xml file. Still didn't get any error notifications, but the result was the same; no backup files created and the original files remained untouched.

Permissions on the directories and the two files have been reset back to what they were.

Is there a way to capture what's going on when the .xml file is run to a log file we can then examine?
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam
Reply With Quote
  #50  
Old 06 Feb 2017, 19:59
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by Snowhog View Post
I'll do that if it really becomes necessary.

As neither the source files are being changed; date/time stamp isn't changing; and the backup files aren't being created, I thought maybe it's a permission issue, like it was with the other MOD I mucked with.

Both directories; admincontrolpanel and inlcudes; have permissions of 755. The contents of both directories have permissions of 644. I changed the directories to 775 and the two individual .php files to 775 and reran the installation .xml file. Still didn't get any error notifications, but the result was the same; no backup files created and the original files remained untouched.

Permissions on the directories and the two files have been reset back to what they were.

Is there a way to capture what's going on when the .xml file is run to a log file we can then examine?
If you have errors and/or warnings being suppressed by your config.php file, try turning that off (just comment that out) when you run the install. When done, then uncomment those lines.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #51  
Old 06 Feb 2017, 21:14
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
Nothing in config.php that would suppress error logging.

grep error config.php returns:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What version of PHP are you running? Our server is running 5.5.9.
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam

Last edited by Snowhog; 06 Feb 2017 at 21:21.
Reply With Quote
  #52  
Old 07 Feb 2017, 02:58
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
Two Install Codes?

Should this be? Two versions of the Install code? Version 1.0 appears complete. Version 1.1 is only a fragment. Not even sure where version 1.1 came from.
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam
Reply With Quote
  #53  
Old 07 Feb 2017, 03:17
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by Snowhog View Post
Should this be? Two versions of the Install code? Version 1.0 appears complete. Version 1.1 is only a fragment. Not even sure where version 1.1 came from.
Yes, that looks correct.

After I initially released version 1.0, I realized I missed a file edit, so the install code for version 1.1 catches that missing edit.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #54  
Old 07 Feb 2017, 03:40
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
Thank you.

I have verified that folder and file permissions on the server are correct (didn't really think they weren't, but...)

The only thing I can come up with as to why this MOD isn't getting installed is either, the php commands are not correct (for our installation), or the relative path to the two files isn't correct. I find both possibilities rather unlikely given the author.

I can provide you with my SSH login credentials via separate PMs if you are still inclined to go in and look around. I would like to get this problem resolved so the MOD can actually get installed.
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam
Reply With Quote
  #55  
Old 10 Feb 2017, 21:42
sub_ubi sub_ubi is offline
 
Join Date: Dec 2004
Working well with 4.2.5 Beta 1 + PHP 7.0

Did an edit+replace on the xml file for my custom admincp, otherwise no issues.
Reply With Quote
  #56  
Old 10 Feb 2017, 22:24
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
I wish that were true here. Still waiting for MarkFL to ascertain why it won't install on our Forum.
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam
Reply With Quote
  #57  
Old 13 Feb 2017, 22:38
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
The first part of the .xml instructions was executed properly.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The ranks database was altered to add rankorder.


But the remaining code isn't being executed, or is failing, as the two files: ranks.php and functions_ranks.php; are not being backed up or modified. This leaves me to believe that the (php ?) commands aren't correct (for us), or the permissions on the folders and/or .php files are wrong.

The folders containing ranks.php and functions_ranks.php are set with permissions 755 (rwxr-xr-x) and the .php files are set with permissions 644. I'm 99.999% confident that these are correct.

MarkFL@

I understand that you are quite busy at the moment, so I am more than willing to try and debug this installation issue on my own.

When the .xml file is executed, is it PHP that is running the code?
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam

Last edited by Snowhog; 13 Feb 2017 at 22:50.
Reply With Quote
  #58  
Old 14 Feb 2017, 14:28
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Hey Paul,

The only things I can think of that would prevent the files from being altered is either the folder permissions aren't correct, or the files are not located where they need to be. I have installed this product a multitude of times on many sites and never had any issues. However, none of these sites had the "admincp" folder renamed.

The install code is PHP, and I have used it on sites running PHP 5.2.x - 7.x.

Just to double check, before you install:
  1. Did you create a folder called "admincp" in the same folder your renamed "admincp" folder is located?
  2. Did you put a copy of your "ranks.php" file there?
  3. Ensure permissions of "admincp" folder is 0755 and permissions of "admincp/ranks.php" is 0644?
  4. After install, copy the files (the backup and the altered "ranks.php" file) in the "admincp" folder to your renamed "admincp" folder?
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #59  
Old 14 Feb 2017, 14:36
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
Yes, I did that previously, but I'll repeat it again, making sure that the permissions on the created folder and the file put in it are as stated. I'll also ensure that the other file; functions_ranks.php has the indicated permissions.

I'll report back on the results.
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam
Reply With Quote
  #60  
Old 14 Feb 2017, 16:34
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Real name: Paul L
Unhappy No joy in Mudville

I'm sad to report that there was no success here. This is the first MOD that has failed to install on our Forum.

I verified the permissions on the created admincp folder, as well as the copy of ranks.php that was put in to it. I verified that the permissions on functions_ranks.php in the includes folder had the right permissions. The MOD simply doesn't get installed. Neither of the .php files gets backed up, and they don't get modified. The database does get the added field, and when I run the uninstall on the MOD, the database is updated to remove the added field. Everything else in the .xml doesn't work for me.

I'm still wondering if it's our version of PHP that is the issue.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I suggest this based only on the syntax of the file_get_contents and file_put_contents functions. Both utilize FILE_USE_INCLUDE_PATH, and according to php.net (Documentation):
Example #2 Searching within the include_path

<?php
// <= PHP 5
$file = file_get_contents('./people.txt', true);
// > PHP 5
$file = file_get_contents('./people.txt', FILE_USE_INCLUDE_PATH);
?>
this implies your version of PHP is greater than version 5.

When I start up PHP interactively (php -a) and execute:

$file = file_get_contents('./admincp/ranks.php', FILE_USE_INCLUDE_PATH);

I don't get any error message, but the contents of the $file variable doesn't appear to contain anything. When I execute:

echo $file

or

print $file

I only get the php prompt.

I won't ask you to spend any more time on this; unless you want to. I'm not going to try and manually modify the two files, as I don't have the knowledge to properly understand what the .xml is saying with regards how the two .php files are changed, and I don't want to make a mess of things.
__________________
"It is a capital mistake to theorize in advance of the facts." - Sherlock Holmes
Kubuntu Forums . Net | ZB BLOCK | StopForumSpam

Last edited by Snowhog; 14 Feb 2017 at 16:40.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 19:39.

Layout Options | Width: Wide Color: