Other sorting method?

12 years 1 week ago #199465 by psycl1
Other sorting method? was created by psycl1
Hello, I am using CB on Joomla 2.5.

The plugin works fine but we are a clan and so we have several ranks like Member, Trialmember, User, Vorstand and so on.

The thing is, I would like to sort the users so Vorstand is at top, then Leader, Co Leader, Member and at the bottom Trialmember and Users.

Is there a way to do that?

Greeting from Germany

Please Log in to join the conversation.

12 years 1 week ago #199516 by psycl1
Replied by psycl1 on topic Re: Other sorting method?
anyone an idea?

Please Log in to join the conversation.

12 years 1 week ago #199560 by psycl1
Replied by psycl1 on topic Re: Other sorting method?
hello??? Any suggestions? Maybe a simple "no", that doesnt work??

Please Log in to join the conversation.

12 years 1 week ago #199662 by billraydrums
Replied by billraydrums on topic Re: Other sorting method?
I think I have a solution for you, but you're going to have to be a little bit comfortable playing around with PHP code.

• Go download Tablesorter.js tablesorter.com/docs/, upload that folder to your root.

• Open up the file components/com_profiler/plugin/templates/default/default.php

• Around line 465 you will find a table with the ID "cbUserTable".
This is the line:
<table id="cbUserTable" class="cbUserListTable cbUserListT_<?php echo $this->listid ?>">

Change it to this:
<table id="cbUserTable" class="tablesorter">

Then go to the index.php file of your template and put the following in the <HEAD> area:

<script type="text/javascript" src="/path/to/jquery-latest.js"></script>
<script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script>
<link rel="stylesheet" href="path/to/stylesheet/blue/style.css" type="text/css" media="print, projection, screen" />

With a little bit of futzing around you'll get those table headers sorting like a champ!
jammingout.net/index.php/component/comprofiler/userslist/Our%20Entire%20Network/search?Itemid=302

Good luck! If you need any help PM me. :D
The following user(s) said Thank You: pepperstreet

Please Log in to join the conversation.

12 years 1 week ago #199788 by psycl1
Replied by psycl1 on topic Re: Other sorting method?
Hi, thank you for the help. But in my template file I don't have a <head>

And when I put the code in there, my site won't load and show only a blank page. :/

Please Log in to join the conversation.

12 years 1 week ago #199824 by pepperstreet
Replied by pepperstreet on topic Re: Other sorting method?

psycl1 wrote: Hi, thank you for the help. But in my template file I don't have a <head>
And when I put the code in there, my site won't load and show only a blank page. :/


To be honest, if you don´t find the location in your template (which framework?), than you should not do any heavy edits to your CB installation. Though, in this case it is an addition to the default.php template file. At least, do this changes on a duplicate template...

Hint: There are joomla template frameworks, which loads the HEAD part in their own subfiles or php layout blocks! So, you will not see the typical head information in your top-most INDEX.php

Alternative:
As far as I understand your initial question... you might want a "grouping" in your list, right?! You can SORT a userlist by your ranking. Since sorting is only possible in DESC/ASC order... you have a slight problem with your alphabetical hierarchy ;-) CoLeader would be listed before Leader... maybe a change to "Leader (Co)" is a workaround?!

Since you have no good visual differenciation with a simple "text" rank, you might create graphics for each rank. Then simply output them in another "delimiter" field.

Addition:
You can also create multiple lists! A filter on your "rank" field is the key. Instead of the build-in list switcher... you might create multiple links to all of your lists. As menuitems OR manually above your global list!


PS: Gruß aus Hamburg

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.228 seconds

Facebook Twitter LinkedIn