vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Profile Enhancements - Customizable Roster (Member List) (https://vborg.vbsupport.ru/showthread.php?t=141311)

m002.p 09-04-2007 10:20 AM

I believe it is possible to set it up like that regarding your first point. It would simply require the table / td code to be rewritten to display it the other way round than as default.

Your second point may not be easily done as Sarcoths hack is basically like showgroups.php and feeds information straight from what usergroups you have set. However, this doesnt mean to say its impossible as I think the code in the two templates can be modded to so the table displays differently.

If i get some free time before Sarcoth does, ill try look into it, but cant promise anything due to a busy work schedule at this time...

sheryarpatel 11-12-2007 08:46 PM

compatible with 3.6.8?

Bludysky 11-15-2007 03:02 AM

I don't mind that this is grouped by forum usergroups, but I would like the users in those usergroups sorted by their character Class and then Character Name.

So in SQL it would be ORDER BY usergroup, class, name I.E. two of those would be custom fields. Its way too rusty with PHP these days, anyone want to give me a hand with some additional sorting of this?

m002.p 11-16-2007 11:00 AM

Quote:

Originally Posted by sheryarpatel (Post 1381307)
compatible with 3.6.8?

Yes it is compatible mate, there are no reported issues.

Bludysky 11-16-2007 04:43 PM

Quote:

Originally Posted by Bludysky (Post 1382767)
I don't mind that this is grouped by forum usergroups, but I would like the users in those usergroups sorted by their character Class and then Character Name.

Never mind.. I broke down and looked up the stupid custom sort function... If anyone else would like to order by custom fields so that you have your users broken down by usergroups (as it is by default), and then arranged by a custom field (I use character class/profession), and then alphabetical by character name (as defined by a custom field, this is not the same as the normal username) the following code will work.

Below the print_users function, create a seperate function:

PHP Code:

function myCmpName($a$b){

    if(
$a['field6'] == $b['field6']){
        return 
strnatcasecmp($a['field7'],$b['field7']);
    }
    else{
        return 
strnatcasecmp($a['field6'],$b['field6']);
    }



In my case, field6 is the character class, and field7 is the user defined character name. You may change these fields to any # you wish according to what fields you wish to sort by. In my case field6 is the first level to sort by, and field7 is the second.

*NOTE* If you want to arrange by the actual vBulletin username/login, I believe you can replace the above ['field7'] with ['username']

Now, scroll down until you see the chunk of code:
PHP Code:

        foreach ($groupcache AS $users) {
            
//if ($usersort == 'username') { ksort($users); } else { krsort($usersort); }
            
ksort($users); // Alphabetically Sort Users 

Replace that with:
PHP Code:

        foreach ($groupcache AS $users) {
            
//if ($usersort == 'username') { ksort($users); } else { krsort($usersort); }
            //ksort($users); // Alphabetically Sort Users
            
usort($usersmyCmpName); 

That will give you a roster that looks something like:

GUILD ROSTER

Council:

Bian - Druid
Irk - Druid
Lila - Necro
Aaler - Ranger
Fina - Ranger
Taje - Warrior

Members:

Aamoon - Bard
Beats - Bard
Eyo - Bard
Yian - Bard
Kabb - Berzerker
Vash - Berzerker
Bin - Cleric
Fye - Cleric
Hika - Cleric
Laur - Cleric


etc etc etc.

Hope thats clear, and that i didn't forget to add anything :D

Foxtrotelite 12-08-2007 05:06 PM

I like that idea bludysky. Is there a way to do that and set the order you want classes to be in? By this I mean like a ranking structure such as:

Council:

Bian - GEN
Irk - LTG
Lila - MG
Aaler - BG
Fina - BG

Members:

Aamoon - COL
Beats - LTC
Eyo - MAJ
Yian - CPT
Kabb - 1LT
Vash - PVT
and so on

Or even just a way to be able to move names up and down on the roster in the order you want them to be displayed in.

Thanks

Bludysky 12-15-2007 11:27 PM

Well I suppose you could do that by adjusting the myCmpName function. To do a more complex compare and sort. Would be a bit tricky and would be somewhat slow'ish though I would think. Instead of just doing a compare between two fields, you could do some switch statements to sort them into the right classes, and then do a compare on the name. At least I think that would work.

boxerman 01-02-2008 01:13 PM

Thanks! jsut what i needed

Foxtrotelite 01-04-2008 03:22 PM

Quote:

Originally Posted by Bludysky (Post 1401824)
Well I suppose you could do that by adjusting the myCmpName function. To do a more complex compare and sort. Would be a bit tricky and would be somewhat slow'ish though I would think. Instead of just doing a compare between two fields, you could do some switch statements to sort them into the right classes, and then do a compare on the name. At least I think that would work.

Thanks for the reply, although I have no idea how to do any of that:D

Brundlefly 01-06-2008 02:21 PM

Quote:

Originally Posted by Foxtrotelite (Post 1397471)
I like that idea bludysky. Is there a way to do that and set the order you want classes to be in? By this I mean like a ranking structure such as:

Council:

Bian - GEN
Irk - LTG
Lila - MG
Aaler - BG
Fina - BG

Members:

Aamoon - COL
Beats - LTC
Eyo - MAJ
Yian - CPT
Kabb - 1LT
Vash - PVT
and so on

Or even just a way to be able to move names up and down on the roster in the order you want them to be displayed in.


Thanks

I had a need for something similiar what your asking for here. Instead of the text for the rank I used the rank image, then I named those specific ranks (In User Profile field) with a number of the order I wanted them displayed by. Then when sorted they will fall in the roster by the number order. Its sort of a headache but it looks nice.

My Roster

You'll need to modify your showroster.php and include something similiar to the below.

After
Code:

$usercount++;
Add the below, modified to your ranks

Code:

$classurl = 'images/spacer.gif';
if ($user[field9] == '1 - Area General') { $classurl = 'forum/images/custom/AGEN.gif'; }
if ($user[field9] == '2 - Brigade General') { $classurl = 'forum/images/custom/BGEN.gif'; }
if ($user[field9] == '3 - General') { $classurl = 'forum/images/custom/GEN.gif'; }
if ($user[field9] == '4 - Lieutenant General') { $classurl = 'forum/images/custom/LTG.gif'; }
if ($user[field9] == '5 - Colonel') { $classurl = 'forum/images/custom/COL.gif'; }
if ($user[field9] == '6 - Lieutenant Colonel') { $classurl = 'forum/images/custom/LTC.gif'; }
if ($user[field9] == '7 - Major') { $classurl = 'forum/images/custom/MAJ.gif'; }
if ($user[field9] == '8 - Captain') { $classurl = 'forum/images/custom/CPT.gif'; }
if ($user[field9] == '9 - Lieutenant') { $classurl = 'forum/images/custom/LT.gif'; }
if ($user[field9] == '10 - Sergeant') { $classurl = 'forum/images/custom/SGT.gif'; }
if ($user[field9] == '11 - Corporal') { $classurl = 'forum/images/custom/CPL.gif'; }
if ($user[field9] == '12 - Private 1st Class') { $classurl = 'forum/images/custom/PFC.gif'; }
$classimage = '<img src="'.$classurl.'" border="0" alt="'.$user[field9].'">';

In your showroster_userbits templates you need to add the below where you want it to fall in the roster and add a column heading in the showroster_header

Code:

<td class="$bgclass" nowrap="nowrap" align="center">$classimage1</td>
Of course make sure you include those images. Its been awhile since I did this and i'm not that savy. But, I hope this helps


All times are GMT. The time now is 07:10 AM.

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.01766 seconds
  • Memory Usage 1,766KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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