I'm using K2 with joomla 1.7. I've made a user list, which I've divided into 3 parts, which I display as columns next to each other (to have a better overview). In fact I now have 3 user lists: A-G, H-M and N-Z.. So far so good, see my website www.kunstinlochem.nl/index.php/2011-10-2.../info-voor-bezoekers
I would like to have these lists alphabetically sorted, and I did so at the back end . In the back end module you can pick specific users and it says "sort with drag and drop" (see the screenshot). This suggests to me that the ordering displayed at the back end is 'leading'. However, this ordering is not visible at the front end, in fact it is a mess and I cannot see any logic in the displayed ordering (not by items/id's/date).
(For the complete list, alphabetical ordering is no problem). What is going wrong here?
I am having the same issue. I looked in the module code, and it appears to me that when using a specific list, that is is simply sorting by User ID (lowest to highest). I can't see anyway around this other than simply coding the module to pay attention to the listed order.
for another slightly different solution, I was using the DB query to sort the list by name instead of me having to re-order everybody all the time. I've used the Ordering value from the Filter Section to help drive behavior in the Specific Users section.
FTP to your installation, navigate to the same file
modules/mod_k2_users/helper.php
$query="SELECT users.name,users.email, users.id AS UID, profiles.* FROM #__users AS users LEFT JOIN #__k2_users AS profiles ON users.id=profiles.userID WHERE users.block=0 AND users.id IN (".implode(',',$IDs).")";
if($_alphaHack)$query.=" ORDER BY users.name ASC";
// this will sort by how it is listed in the admin console if(!$_alphaHack){ $newUserObjects=array(); foreach($IDsas$id){ foreach($userObjectsas$uO){ if($uO->UID==$id){ $newUserObjects[]=$uO; break; } } } $userObjects=$newUserObjects; } // end hack
Last Edit: 10 months, 1 week ago by Greg. Reason: specify the file to modify and make the code block CODE formatted