Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Sort View Forum Leaders VB 4.1.11 Details »
Sort View Forum Leaders VB 4.1.11
Mod Version: 1.00, by GrabMyWrist (Member) GrabMyWrist is offline
Developer Last Online: Mar 2016 I like it Show Printable Version Email this Page

vB Version: 4.1.11 Rating: (2 votes - 5.00 average) Installs: 13
Released: 15 Mar 2012 Last Update: Never Downloads: 45
Not Supported Code Changes Re-usable Code  

This mod is fairly simple and straightforward.

First, you need to edit the title of the groups you want to display on showgroups.php. To do so you need to edit the group via Usergroups in the Control Panel.

Example:

Site Admin

Site Staff

Moderator

You need to place the following in front of the title of each usergroup you want displayed and sorted.

<! -- x -- >

x is replaced with a number of the order you wish for them to be displayed.


Example:

<! -- 1 -->Site Admin

<! -- 2 -->Site Staff

<! -- 3 -->Moderator


Also, ensure that each group is set to be "Viewable on Show Groups" under Usergroup Options of each group.

Finally, we have to remove the default Moderators list that appears on showgroups.php when you click View Forum Leaders.

To do this you need to edit showgroups.php directly.

Open showgroups.php in your forum root, find the following code and remove it.




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


Download Now

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

Screenshots

Click image for larger version

Name:	Usergroup Edit 1.jpg
Views:	359
Size:	30.7 KB
ID:	137027   Click image for larger version

Name:	Usergroup Edit 2.jpg
Views:	282
Size:	10.5 KB
ID:	137028   Click image for larger version

Name:	View Forum Leaders.jpg
Views:	538
Size:	48.0 KB
ID:	137029  

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.
Similar Mod
Mod Developer Type Replies Last Post
Miscellaneous Hacks Cel Forum Leaders - show only primary usergroups on showgroups.php cellarius vBulletin 4.x Add-ons 9 17 Dec 2012 02:59

Comments
  #2  
Old 01 May 2012, 04:46
deadlySniper deadlySniper is offline
 
Join Date: Dec 2008
Location: New York
Real name: Ryan Carr
So I did this and my groups dont show up in the order I have them. I started at 10 and went to 29. And it does it in the usergroup editor but not the forum leaders
Reply With Quote
  #3  
Old 03 Jun 2012, 12:20
owning_y0u owning_y0u is offline
 
Join Date: Dec 2008
Works like a charme :-) only its not updating directly. not a real problem tough :-P

Added the showgroups.php file to make it more easy for less advanced users.

the showgroups.php file is for vb 4.2 ONLY!
Attached Files
File Type: php showgroups.php (8.6 KB, 48 views)
Reply With Quote
  #4  
Old 14 Jun 2012, 00:11
Popa Andrei's Avatar
Popa Andrei Popa Andrei is offline
 
Join Date: May 2008
Real name: Popa Andrei Florin
Works like a charm,installed it and marked.
__________________
EliteGamers Arena
Best private servers.Join us now!
Reply With Quote
  #5  
Old 20 Jun 2012, 13:07
1F42 1F42 is offline
 
Join Date: Mar 2003
Originally Posted by deadlySniper View Post
So I did this and my groups dont show up in the order I have them. I started at 10 and went to 29. And it does it in the usergroup editor but not the forum leaders
Only works up to 9 as it seems to only recognise the first digit so 10 and 11 become equal to 1 and 25 or 29 would be seen equal to 2 so awkward to use if you have more than 9 usergroups.
Reply With Quote
  #6  
Old 18 Oct 2014, 18:52
Voodoo262 Voodoo262 is offline
 
Join Date: Dec 2009
Thank you to GrabMyWrist for writing this up. I was able to set this mod up to my liking on our site. Here are a few notes for people that are having issues.

First of all, when using the HTML comments (<!-- x -->) to embed/define the sort order, remember that PHP (like most computer software) uses pure ASCII sorting, not numeric sorting, when sorting strings of characters. Therefore, "10" will come before "2" (because it compares "1" against "2"), "3456" will come before "7" (because it compares "3" against "7"), and so forth. If you want the mod to obey your sort order, all of the numbers must have the same number of digits. So if you have at least 10 usergroups you want to display, I would recommend using 2 digits for all the numbers, for example:

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


Second, when you modify your showgroups.php, make sure you also delete the "if" statement before the block of code that GrabMyWrist posted, otherwise you risk breaking the page completely due to syntax and/or runtime errors, because PHP will be interpreting the code as follows:

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

...Meaning it will only initialize and set the value of the $navpopup variable if the preceding condition is true. This is dangerous.

Here is the full block of code you'll want to delete. Actually, what I did was enclose it in comments by placing a "/*" before and a "*/" after, effectively accomplishing the same thing but without getting rid of the original code:

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



Finally, after you have updated the usergroup titles, you'll have to reset the group cache in order for the sorting to take effect. This can be accomplished by running the following SQL query. The cache will be rebuilt the next time you reload the page:

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


I have attached my version of showgroups.php (vB 4.2.2) for your convenience (make sure you update your vBulletin License at the top). It also includes another optimization that moves the sorting from the PHP into the MySQL (because after all, what's the point of caching if you're gonna sort the cache every time anyways? )

This ends today's programming lesson
Attached Files
File Type: php showgroups.php (13.2 KB, 11 views)
__________________
-Rob
Sysadmin and vB Admin at
The Galant Center ("TGC")

Last edited by Voodoo262; 20 Oct 2014 at 00:37.
Reply With Quote
  #7  
Old 18 Oct 2014, 19:52
tme_power tme_power is offline
 
Join Date: Sep 2006
Looking for this a while ago, cant do it myself. Work like a charm.
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 13:48.

Layout Options | Width: Wide Color: